mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-29 09:04:17 +00:00
62 lines
1.9 KiB
Diff
62 lines
1.9 KiB
Diff
diff --git a/mk b/mk
|
|
index a5baa0f..4ed2350 100644
|
|
--- a/mk
|
|
+++ b/mk
|
|
@@ -25,7 +25,7 @@ const rm = (x) => {
|
|
};
|
|
const pj = JSON.parse(rf('package.json'));
|
|
// v:version string - "x.y.z" where z is the number of commits since the beginning of the project
|
|
-const v = `${pj.version.replace(/\.0$/, '')}.${sh('git rev-list --count HEAD')}`;
|
|
+const v = "@version@";
|
|
const isDyalogBuild = /^dyalog/.test(pj.name);
|
|
const tasks = { };
|
|
|
|
@@ -36,8 +36,8 @@ const b = (f) => {
|
|
const vi = {
|
|
versionInfo: {
|
|
version: v,
|
|
- date: sh('git show -s HEAD --pretty=format:%ci'),
|
|
- rev: sh('git rev-parse HEAD'),
|
|
+ date: 'unknown',
|
|
+ rev: 'nixpkgs',
|
|
},
|
|
};
|
|
wf('_/version.js', `D=${JSON.stringify(vi)}`);
|
|
@@ -51,8 +51,7 @@ const incl = new RegExp('^$'
|
|
const pkg = (x, y, f) => {
|
|
rq('electron-packager')({
|
|
dir: '.',
|
|
- platform: x,
|
|
- arch: y,
|
|
+ asar: true,
|
|
tmpdir: '/tmp/ridebuild',
|
|
out: `_/${pj.name}`,
|
|
overwrite: true,
|
|
@@ -79,8 +78,8 @@ const pkg = (x, y, f) => {
|
|
ProductName: 'RIDE',
|
|
InternalName: 'RIDE',
|
|
},
|
|
- }).then(() => {
|
|
- const d = `_/${pj.name}/${pj.productName}-${x}-${y}`;
|
|
+ }).then(paths => {
|
|
+ const d = paths[0];
|
|
rm(`${d}/version`);
|
|
fs.existsSync(`${d}/LICENSE`) && mv(`${d}/LICENSE`, `${d}/LICENSE.electron`);
|
|
generateLicenses(`${d}/ThirdPartyNotices.txt`);
|
|
@@ -88,6 +87,7 @@ const pkg = (x, y, f) => {
|
|
}, e => f(e));
|
|
};
|
|
|
|
+const self = (f) => { b(e => (e ? f(e) : pkg(undefined, undefined, f))); };
|
|
const l = (f) => { b(e => (e ? f(e) : pkg('linux', 'x64', f))); };
|
|
const w = (f) => { b(e => (e ? f(e) : pkg('win32', 'ia32', f))); };
|
|
const o = (f) => { b(e => (e ? f(e) : pkg('darwin', 'x64', f))); };
|
|
@@ -109,6 +109,7 @@ tasks.ma=ma; tasks.masarm = ma;
|
|
tasks.a = a; tasks.arm = a;
|
|
tasks.d = d; tasks.dist = d;
|
|
tasks.c = c; tasks.clean = c;
|
|
+tasks.self = self;
|
|
|
|
async.each(
|
|
process.argv.length > 2 ? process.argv.slice(2) : ['build'],
|