summary refs log tree commit diff
path: root/pkgs/tools/graphics
diff options
context:
space:
mode:
authorDomen Kožar <domen@dev.si>2016-02-01 21:09:34 +0000
committerDomen Kožar <domen@dev.si>2016-02-01 21:09:34 +0000
commit0b3becb2697a8d0a00344cc3370a7d7ad67290fc (patch)
tree2b60473ae33a227b26f66912b613de1a1365d744 /pkgs/tools/graphics
parent9dbe54afaf4e6f279f7738022409bdd25cc81762 (diff)
parent5e189bd207c78b5d3dd7161640bdca756dff04cb (diff)
downloadnixlib-0b3becb2697a8d0a00344cc3370a7d7ad67290fc.tar
nixlib-0b3becb2697a8d0a00344cc3370a7d7ad67290fc.tar.gz
nixlib-0b3becb2697a8d0a00344cc3370a7d7ad67290fc.tar.bz2
nixlib-0b3becb2697a8d0a00344cc3370a7d7ad67290fc.tar.lz
nixlib-0b3becb2697a8d0a00344cc3370a7d7ad67290fc.tar.xz
nixlib-0b3becb2697a8d0a00344cc3370a7d7ad67290fc.tar.zst
nixlib-0b3becb2697a8d0a00344cc3370a7d7ad67290fc.zip
Merge pull request #12701 from mayflower/builder-def-cleanup
builderDefsPackage cleanup
Diffstat (limited to 'pkgs/tools/graphics')
-rw-r--r--pkgs/tools/graphics/cuneiform/default.nix37
-rw-r--r--pkgs/tools/graphics/welkin/default.nix68
2 files changed, 30 insertions, 75 deletions
diff --git a/pkgs/tools/graphics/cuneiform/default.nix b/pkgs/tools/graphics/cuneiform/default.nix
index 138ae58da064..c357c96fac8d 100644
--- a/pkgs/tools/graphics/cuneiform/default.nix
+++ b/pkgs/tools/graphics/cuneiform/default.nix
@@ -1,42 +1,19 @@
-a @ { cmake, patchelf, imagemagick, ... } :
-let
-  fetchurl = a.fetchurl;
+{ stdenv, fetchurl, cmake, patchelf, imagemagick }:
 
+stdenv.mkDerivation rec {
+  name = "cuneiform-${version}";
   version = "1.1.0";
-  buildInputs = with a; [
-    cmake imagemagick patchelf
-  ];
-in
-rec {
+
   src = fetchurl {
     url = "https://launchpad.net/cuneiform-linux/1.1/1.1/+download/cuneiform-linux-1.1.0.tar.bz2";
     sha256 = "1bdvppyfx2184zmzcylskd87cxv56d8f32jf7g1qc8779l2hszjp";
   };
 
-  inherit buildInputs;
-  configureFlags = [];
-
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["doCmake" "doMakeInstall" "postInstall"];
-
-  libc = if a.stdenv ? glibc then a.stdenv.glibc else "";
-
-  doCmake = a.fullDepEntry(''
-    mkdir -p $PWD/builddir
-    cd builddir
-    export NIX_LDFLAGS="$NIX_LDFLAGS -ldl -L$out/lib"
-    cmake .. -DCMAKE_BUILD_TYPE=debug -DCMAKE_INSTALL_PREFIX=$out -DDL_LIB=${libc}/lib
-  '') ["minInit" "addInputs" "doUnpack" "defEnsureDir"];
-
-  needLib64 = a.stdenv.system == "x86_64-linux";
-
-  postInstall = a.fullDepEntry(''
-    patchelf --set-rpath $out/lib${if needLib64 then "64" else ""}${if a.stdenv.cc.cc != null then ":${a.stdenv.cc.cc}/lib" else ""}${if a.stdenv.cc.cc != null && needLib64 then ":${a.stdenv.cc.cc}/lib64" else ""}:${a.imagemagick}/lib $out/bin/cuneiform
-  '') ["minInit" "addInputs" "doMakeInstall"];
+  buildInputs = [
+    cmake imagemagick
+  ];
 
-  name = "cuneiform-" + version;
   meta = {
-    inherit version;
     description = "Multi-language OCR system";
   };
 }
diff --git a/pkgs/tools/graphics/welkin/default.nix b/pkgs/tools/graphics/welkin/default.nix
index 3d1a2aa5bdc0..6e268ef5941d 100644
--- a/pkgs/tools/graphics/welkin/default.nix
+++ b/pkgs/tools/graphics/welkin/default.nix
@@ -1,57 +1,35 @@
-x@{builderDefsPackage
-  , jre
-  , ...}:
-builderDefsPackage
-(a :
-let
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
-    ["jre"];
+{ stdenv, fetchsvn, jre, makeWrapper }:
 
-  buildInputs = map (n: builtins.getAttr n x)
-    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
-  sourceInfo = rec {
-    baseName="welkin";
-    version="1.1";
-    name="${baseName}-${version}";
-    url="http://simile.mit.edu/dist/welkin/${name}.tar.gz";
-    hash="0hr2xvfz887fdf2ysiqydv6m13gbdl5x0fh4960i655d5imvd5x0";
-  };
-in
-rec {
-  src = a.fetchurl {
-    url = sourceInfo.url;
-    sha256 = sourceInfo.hash;
-  };
+stdenv.mkDerivation rec {
+  name = "welkin-${version}";
+  version = "1.1";
 
-  inherit (sourceInfo) name version;
-  inherit buildInputs;
+  src = fetchsvn {
+    url = "http://simile.mit.edu/repository/welkin";
+    rev = "9638";
+    sha256 = "1bqh3vam7y805xrmdw7k0ckcfwjg88wypxgv3njkkwyn7kxnfnqp";
+  };
 
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["doDeploy" "createBin"];
+  sourceRoot = "welkin-r9638/tags/${version}";
 
-  doDeploy = a.simplyShare "welkin";
+  buildInputs = [ jre makeWrapper ];
 
-  createBin = a.fullDepEntry ''
-    mkdir -p "$out/bin"
-    echo "#! ${a.stdenv.shell}" > "$out/bin/welkin"
-    echo "export JAVA_HOME=${jre}" >> "$out/bin/welkin"
-    echo "\"$out/share/welkin/welkin.sh\" \"\$@\"" >> "$out/bin/welkin"
-    sed -e 's@[.]/lib/welkin[.]jar@"'"$out"'/share/welkin/lib/welkin.jar"@' -i "$out/share/welkin/welkin.sh"
-    chmod a+x "$out/bin/welkin"
-  '' ["minInit" "defEnsureDir"];
+  installPhase = ''
+    mkdir -p $out/{bin,share}
+    cp -R . $out/share
+    cp $out/share/welkin.sh $out/bin/welkin
+    sed -e 's@\./lib/welkin\.jar@'"$out"'/share/lib/welkin.jar@' -i $out/bin/welkin
+    wrapProgram $out/bin/welkin \
+      --set JAVA_HOME ${jre}
+    chmod a+x $out/bin/welkin
+  '';
 
   meta = {
     description = "An RDF visualizer";
-    maintainers = with a.lib.maintainers;
-    [
+    maintainers = with stdenv.lib.maintainers; [
       raskin
     ];
     hydraPlatforms = [];
-    license = a.lib.licenses.free;
-  };
-  passthru = {
-    updateInfo = {
-      downloadPage = "http://simile.mit.edu/dist/welkin/";
-    };
+    license = stdenv.lib.licenses.free;
   };
-}) x
+}