From 4c985c26af29ffe91c05c60b62ad2b7a2194ac76 Mon Sep 17 00:00:00 2001 From: "Antoine R. Dumont" Date: Sat, 7 Mar 2015 17:47:58 +0100 Subject: [PATCH 1/3] Update swt installation Permit the installation for x86_64 --- pkgs/development/libraries/java/swt/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/java/swt/default.nix b/pkgs/development/libraries/java/swt/default.nix index f64edce7b4c1..795062f12d5f 100644 --- a/pkgs/development/libraries/java/swt/default.nix +++ b/pkgs/development/libraries/java/swt/default.nix @@ -6,16 +6,24 @@ , libsoup }: -stdenv.mkDerivation { - name = "swt-3.7.2-201202080800"; +let metadata = if stdenv.system == "i686-linux" + then { arch = "x86"; sha256 = "10si8kmc7c9qmbpzs76609wkfb784pln3qpmra73gb3fbk7z8caf"; } + else if stdenv.system == "x86_64-linux" + then { arch = "x86_64"; sha256 = "0hq48zfqx2p0fqr0rlabnz2pdj0874k19918a4dbj0fhzkhrh959"; } + else { }; +in stdenv.mkDerivation rec { + version = "3.7.2"; + fullVersion = "${version}-201202080800"; + name = "swt-${version}"; + builder = ./builder.sh; # Alas, the Eclipse Project apparently doesn't produce source-only # releases of SWT. So we just grab a binary release and extract # "src.zip" from that. src = fetchurl { - url = "http://archive.eclipse.org/eclipse/downloads/drops/R-3.7.2-201202080800/swt-3.7.2-gtk-linux-x86.zip"; - sha256 = "10si8kmc7c9qmbpzs76609wkfb784pln3qpmra73gb3fbk7z8caf"; + url = "http://archive.eclipse.org/eclipse/downloads/drops/R-${fullVersion}/${name}-gtk-linux-${metadata.arch}.zip"; + sha256 = metadata.sha256; }; buildInputs = [unzip jdk pkgconfig gtk libXtst libXi mesa webkit libsoup]; From 00fb3c0b7ee3ea1082cf82ae1bf7a691f0d69874 Mon Sep 17 00:00:00 2001 From: "Antoine R. Dumont" Date: Sat, 7 Mar 2015 17:48:54 +0100 Subject: [PATCH 2/3] Add tuxguitar derivation --- .../editors/music/tuxguitar/default.nix | 40 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 42 insertions(+) create mode 100644 pkgs/applications/editors/music/tuxguitar/default.nix diff --git a/pkgs/applications/editors/music/tuxguitar/default.nix b/pkgs/applications/editors/music/tuxguitar/default.nix new file mode 100644 index 000000000000..81c7d2e3e1ed --- /dev/null +++ b/pkgs/applications/editors/music/tuxguitar/default.nix @@ -0,0 +1,40 @@ +{ stdenv, fetchurl, swt, jdk, makeWrapper, alsaLib }: + +let metadata = if stdenv.system == "i686-linux" + then { arch = "x86"; sha256 = "1qmb51k0538pn7gv4nsvhfv33xik4l4af0qmpllkzrikmj8wvzlb"; } + else if stdenv.system == "x86_64-linux" + then { arch = "x86_64"; sha256 = "12af47jhlrh9aq5b3d13l7cdhlndgnfpy61gz002hajbq7i00ixh"; } + else { }; +in stdenv.mkDerivation rec { + version = "1.2"; + name = "tuxguitar-${version}"; + + src = fetchurl { + url = "mirror://sourceforge/tuxguitar/${name}-linux-${metadata.arch}.tar.gz"; + sha256 = metadata.sha256; + }; + + buildInputs = [ makeWrapper ]; + + installPhase = '' + mkdir -p $out + cp -r * $out/ + + wrapProgram $out/tuxguitar \ + --set JAVA "${jdk}/bin/java" \ + --prefix LD_LIBRARY_PATH : "${swt}/lib:${alsaLib}/lib" \ + --prefix CLASSPATH : "${swt}/jars/swt.jar" + ''; + + meta = with stdenv.lib; { + description = "A multitrack guitar tablature editor"; + longDescription = '' + TuxGuitar is a multitrack guitar tablature editor and player written + in Java-SWT. It can open GuitarPro, PowerTab and TablEdit files. + ''; + homepage = http://www.tuxguitar.com.ar/; + license = licenses.lgpl2; + maintainers = [ maintainers.ardumont ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 777c5e3d1ead..a8ce9205c5bd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11693,6 +11693,8 @@ let tribler = callPackage ../applications/networking/p2p/tribler { }; + tuxguitar = callPackage ../applications/editors/music/tuxguitar { }; + twister = callPackage ../applications/networking/p2p/twister { }; twmn = callPackage ../applications/misc/twmn { }; From dd71d7b44b99837ec95fa69cfb0f7d5bd37e53d9 Mon Sep 17 00:00:00 2001 From: "Antoine R. Dumont" Date: Sun, 8 Mar 2015 11:14:02 +0100 Subject: [PATCH 3/3] tuxguitar in $out/bin/ folder Tuxguitar was installed in $out (as per default wrapper script) Thus installing tuxguitar was not in ~/.nix-profile when installed. Now tuxguitar appears in ~/.nix-profile when installed. --- .../editors/music/tuxguitar/default.nix | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/editors/music/tuxguitar/default.nix b/pkgs/applications/editors/music/tuxguitar/default.nix index 81c7d2e3e1ed..09d30ad4e17a 100644 --- a/pkgs/applications/editors/music/tuxguitar/default.nix +++ b/pkgs/applications/editors/music/tuxguitar/default.nix @@ -17,13 +17,17 @@ in stdenv.mkDerivation rec { buildInputs = [ makeWrapper ]; installPhase = '' - mkdir -p $out - cp -r * $out/ + mkdir -p $out/bin + cp -r lib share $out/ + cp tuxguitar $out/bin/tuxguitar + cp tuxguitar.jar $out/lib - wrapProgram $out/tuxguitar \ + ln -s $out/share $out/bin/share + + wrapProgram $out/bin/tuxguitar \ --set JAVA "${jdk}/bin/java" \ - --prefix LD_LIBRARY_PATH : "${swt}/lib:${alsaLib}/lib" \ - --prefix CLASSPATH : "${swt}/jars/swt.jar" + --prefix LD_LIBRARY_PATH : "$out/lib/:${swt}/lib:${alsaLib}/lib" \ + --prefix CLASSPATH : "${swt}/jars/swt.jar:$out/lib/tuxguitar.jar:$out/lib/itext.jar" ''; meta = with stdenv.lib; {