Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patchwork #35334

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,60 @@
{ stdenv, writeScriptBin, path, fetchurl, fetchFromGitHub
, nodejs-8_x, yarn, mkYarnPackage, python, electron }:

with builtins;

let
version = "3.8.10";

nodejs = nodejs-8_x;

nodeHeaders = fetchurl {
url = "https://nodejs.org/download/release/v${nodejs.version}/node-v${nodejs.version}-headers.tar.gz";
sha256 = "1993kcghzr56zmw5sdj8wr8c42mna25806bcjknfxnh62zl4hwpg";
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm doing the exact same thing in another project and it breaks every time I update nixpkgs and the nodejs has been bumped. I think the nodejs package should export the headers in another output like nodejs.dev


patchworkSource = fetchFromGitHub {
owner = "ssbc";
repo = "patchwork";
rev = "v${version}";
sha256 = "16h9ylmlhbszixya5bxm3n6fpdc9gv9zxp0jdr4jd32lr9n3gjbr";
};

patchwork = mkYarnPackage {
name = "patchwork-${version}";
src = patchworkSource;
packageJSON = ./package.json;
yarnLock = ./yarn.lock;
yarnNix = ./yarn.nix;
pkgConfig = {
leveldown = {
buildInputs = [ python ];
postInstall = ''
node ../node-gyp/bin/node-gyp.js rebuild --build-from-source --tarball=${nodeHeaders}
'';
};
"@paulcbetts/spellchecker" = {
buildInputs = [ python ];
postInstall = ''
node ../../node-gyp/bin/node-gyp.js rebuild --build-from-source --tarball=${nodeHeaders}
'';
};
};
};

startupScript = writeScriptBin "patchwork" ''
#! ${stdenv.shell}

set -ex
export APP_ROOT_PATH=${patchwork}/node_modules/ssb-patchwork
exec ${electron}/bin/electron ${patchwork}/node_modules/ssb-patchwork/index.js
'';
in stdenv.mkDerivation {
name = "patchwork";
src = patchwork;

installPhase = ''
mkdir -p $out/bin
ln -s ${startupScript}/bin/patchwork $out/bin/patchwork
'';
}
@@ -0,0 +1,69 @@
{
"name": "ssb-patchwork",
"productName": "Patchwork",
"version": "3.2.0",
"description": "A decentralized messaging and sharing app built on top of Secure Scuttlebutt (SSB).",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "electron index.js",
"postinstall": "npm run rebuild",
"rebuild": "npm rebuild --runtime=electron --target=1.4.3 --abi=50 --disturl=https://atom.io/download/atom-shell"
},
"author": "Secure Scuttlebutt Consortium",
"license": "GPL",
"dependencies": {
"atomic-file": "^0.1.0",
"bulk-require": "^1.0.0",
"catch-links": "^2.0.1",
"compare-version": "^0.1.2",
"data-uri-to-buffer": "0.0.4",
"deep-equal": "^1.0.1",
"depject": "^3.2.0",
"depnest": "^1.0.2",
"electron-default-menu": "~1.0.0",
"electron-spellchecker": "^1.0.4",
"graphmitter": "^1.6.3",
"has-network": "0.0.0",
"insert-css": "~1.0.0",
"is-visible": "^2.1.1",
"level": "~1.4.0",
"level-memview": "0.0.0",
"map-filter-reduce": "~3.0.3",
"micro-css": "^2.0.0",
"mutant": "^3.18.0",
"mutant-pull-reduce": "^1.1.0",
"non-private-ip": "^1.4.1",
"on-change-network": "0.0.2",
"on-wakeup": "^1.0.1",
"patchcore": "~0.4.1",
"prebuild": "github:mmckegg/prebuild#use-npm-conf",
"pull-abortable": "^4.1.0",
"pull-defer": "^0.2.2",
"pull-file": "~1.0.0",
"pull-identify-filetype": "^1.1.0",
"pull-next": "0.0.2",
"pull-notify": "^0.1.1",
"pull-pause": "0.0.0",
"pull-ping": "^2.0.2",
"pull-pushable": "^2.0.1",
"pull-scroll": "github:mmckegg/pull-scroll#0fddc085fc82cfce9f3ccfd4096fce99843a1e51",
"pull-stream": "~3.4.5",
"scuttlebot": "^9.4.4",
"sorted-array-functions": "~1.0.0",
"ssb-avatar": "^0.2.0",
"ssb-blobs": "~0.1.7",
"ssb-keys": "~7.0.0",
"ssb-mentions": "^0.1.1",
"ssb-msgs": "^5.2.0",
"ssb-query": "~0.1.1",
"ssb-ref": "~2.6.2",
"ssb-sort": "^1.0.0",
"statistics": "^3.3.0",
"suggest-box": "^2.2.3",
"text-node-searcher": "^1.1.1"
},
"devDependencies": {
"electron": "~1.4.4"
}
}