forked from desktop/desktop
-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* add patch-package so we can patch a node_modules package * generate patch to disable build-id contents for RPM package * move patch-package command to post-install script * regenerate patch file
- Loading branch information
Showing
10 changed files
with
339 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
diff --git a/node_modules/electron-installer-redhat/resources/spec.ejs b/node_modules/electron-installer-redhat/resources/spec.ejs | ||
index e07a8a3..486f59e 100644 | ||
--- a/node_modules/electron-installer-redhat/resources/spec.ejs | ||
+++ b/node_modules/electron-installer-redhat/resources/spec.ejs | ||
@@ -1,4 +1,5 @@ | ||
%define _binary_payload w<%= compressionLevel %>.xzdio | ||
+%define _build_id_links none | ||
|
||
%if "%{_host_cpu}" != "%{_target_cpu}" | ||
%global __strip /bin/true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
import { promisify } from 'util' | ||
import { join } from 'path' | ||
|
||
import glob = require('glob') | ||
const globPromise = promisify(glob) | ||
|
||
import { rename } from 'fs-extra' | ||
|
||
import { getVersion } from '../app/package-info' | ||
import { getDistPath, getDistRoot } from './dist-info' | ||
|
||
const distRoot = getDistRoot() | ||
|
||
// best guess based on documentation | ||
type RedhatOptions = { | ||
// required | ||
src: string | ||
dest: string | ||
arch: 'x86_64' | ||
// optional | ||
description?: string | ||
productDescription?: string | ||
categories?: Array<string> | ||
icon?: any | ||
scripts?: { | ||
pre?: string | ||
post?: string | ||
preun?: string | ||
postun?: string | ||
} | ||
homepage?: string | ||
mimeType?: Array<string> | ||
requires?: Array<string> | ||
} | ||
|
||
const options: RedhatOptions = { | ||
src: getDistPath(), | ||
dest: distRoot, | ||
arch: 'x86_64', | ||
description: 'Simple collaboration from your desktop', | ||
productDescription: | ||
'This is the unofficial port of GitHub Desktop for Linux distributions', | ||
categories: ['GNOME', 'GTK', 'Development'], | ||
requires: [ | ||
// dugite-native dependencies | ||
'(libcurl or libcurl4)', | ||
// keytar dependencies | ||
'libsecret', | ||
'gnome-keyring', | ||
], | ||
icon: { | ||
'256x256': 'app/static/logos/256x256.png', | ||
'512x512': 'app/static/logos/512x512.png', | ||
'1024x1024': 'app/static/logos/1024x1024.png', | ||
}, | ||
scripts: { | ||
post: 'script/resources/rpm/post.sh', | ||
preun: 'script/resources/rpm/preun.sh', | ||
}, | ||
homepage: 'https://github.com/shiftkey/desktop', | ||
mimeType: [ | ||
'x-scheme-handler/x-github-client', | ||
'x-scheme-handler/x-github-desktop-auth', | ||
// workaround for handling OAuth flow until we figure out what we're doing | ||
// with the development OAuth details | ||
// | ||
// see https://github.com/shiftkey/desktop/issues/72 for more details | ||
'x-scheme-handler/x-github-desktop-dev-auth', | ||
], | ||
} | ||
|
||
export async function packageRedhat(): Promise<string> { | ||
if (process.platform === 'win32') { | ||
return Promise.reject('Windows is not supported') | ||
} | ||
|
||
const installer = require('electron-installer-redhat') | ||
|
||
await installer(options) | ||
const installersPath = `${distRoot}/github-desktop*.rpm` | ||
|
||
const files = await globPromise(installersPath) | ||
|
||
if (files.length !== 1) { | ||
return Promise.reject( | ||
`Expected one file but instead found '${files.join(', ')}' - exiting...` | ||
) | ||
} | ||
|
||
const oldPath = files[0] | ||
|
||
const newFileName = `GitHubDesktop-linux-${getVersion()}.rpm` | ||
const newPath = join(distRoot, newFileName) | ||
await rename(oldPath, newPath) | ||
|
||
return Promise.resolve(newPath) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
INSTALL_DIR="/usr/lib/github-desktop" | ||
CLI_DIR="$INSTALL_DIR/resources/app/static" | ||
|
||
# add executable permissions for CLI interface | ||
chmod +x "$CLI_DIR"/github || : | ||
|
||
# create symbolic links to /usr/bin directory | ||
ln -f -s "$CLI_DIR"/github /usr/bin || : | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
BASE_FILE="/usr/bin/github" | ||
|
||
# remove symbolic links in /usr/bin directory | ||
test -f ${BASE_FILE} && unlink ${BASE_FILE} | ||
|
||
exit 0 |
Oops, something went wrong.