14 src = fetchFromGitHub {
18 hash = "sha256-8QAnZCvSUMuRj/Rd85j79GXDQxl8HlEaiU4StsXDdpU=";
21 npmPkg = buildNpmPackage {
24 pname = "openrefine-npm";
25 sourceRoot = "${src.name}/main/webapp";
27 npmDepsHash = "sha256-u9qledNFqGgMmOIsm2T8w3UoaLbb7WtksUw6xLoRgU8=";
29 # package.json doesn't supply a version, which npm doesn't like - fix this.
30 # directly referencing jq because buildNpmPackage doesn't pass
31 # nativeBuildInputs through to fetchNpmDeps
33 NEW_PACKAGE_JSON=$(mktemp)
34 ${jq}/bin/jq '. + {version: $ENV.version}' package.json > $NEW_PACKAGE_JSON
35 cp $NEW_PACKAGE_JSON package.json
41 cp -r modules/core/3rdparty/* $out/
45 in maven.buildMavenPackage {
51 cp -r ${npmPkg} main/webapp/modules/core/3rdparty
55 mvnParameters = "-pl !packaging";
56 mvnHash = "sha256-SrEsJfiZrPy2zZ0Vzl7+d+8XUHGd2DOOs+PHBOZrbIU=";
58 nativeBuildInputs = [ makeWrapper ];
63 mkdir -p $out/lib/server/target/lib
64 cp -r server/target/lib/* $out/lib/server/target/lib/
65 cp server/target/openrefine-*-server.jar $out/lib/server/target/lib/
67 mkdir -p $out/lib/webapp
68 cp -r main/webapp/{WEB-INF,modules} $out/lib/webapp/
72 if [ -d "$ext/module" ] ; then
73 mkdir -p "$out/lib/webapp/extensions/$ext"
74 cp -r "$ext/module" "$out/lib/webapp/extensions/$ext/"
80 cp refine.ini $out/etc/
87 find $out -name '*.java' -delete
88 sed -i -E 's|^(butterfly\.modules\.path =).*extensions.*$|\1 '"$out/lib/webapp/extensions|" \
89 $out/lib/webapp/WEB-INF/butterfly.properties
91 sed -i 's|^cd `dirname \$0`$|cd '"$out/lib|" $out/bin/refine
93 cat >> $out/etc/refine.ini <<EOF
94 REFINE_WEBAPP='$out/lib/webapp'
95 REFINE_LIB_DIR='$out/lib/server/target/lib'
97 JAVA_HOME='${jdk.home}'
99 # non-headless mode tries to launch a browser, causing a
100 # number of purity problems
101 JAVA_OPTIONS='-Drefine.headless=true'
104 wrapProgram $out/bin/refine \
105 --prefix PATH : '${lib.makeBinPath [ jdk curl ]}' \
106 --set-default REFINE_INI_PATH "$out/etc/refine.ini"
111 updateScript = ./update.sh;
115 description = "Power tool for working with messy data and improving it";
116 homepage = "https://openrefine.org";
117 license = licenses.bsd3;
118 maintainers = with maintainers; [ ris ];
119 sourceProvenance = with sourceTypes; [
121 binaryBytecode # maven dependencies
123 broken = stdenv.hostPlatform.isDarwin; # builds, doesn't run
124 mainProgram = "refine";