summary refs log tree commit diff
path: root/pkgs/applications/office
diff options
context:
space:
mode:
authorChris Martin <ch.martin@gmail.com>2016-09-16 19:24:04 -0400
committerChris Martin <ch.martin@gmail.com>2016-09-16 19:24:04 -0400
commitbb8d294270b36205ff4b5e5de39e37f9f22300c1 (patch)
tree2311b60938f42c938afa91cfb792d9f0ddb71e6f /pkgs/applications/office
parentedcaebf1d9e7b7440985a34e5273b82bce5eb938 (diff)
downloadnixlib-bb8d294270b36205ff4b5e5de39e37f9f22300c1.tar
nixlib-bb8d294270b36205ff4b5e5de39e37f9f22300c1.tar.gz
nixlib-bb8d294270b36205ff4b5e5de39e37f9f22300c1.tar.bz2
nixlib-bb8d294270b36205ff4b5e5de39e37f9f22300c1.tar.lz
nixlib-bb8d294270b36205ff4b5e5de39e37f9f22300c1.tar.xz
nixlib-bb8d294270b36205ff4b5e5de39e37f9f22300c1.tar.zst
nixlib-bb8d294270b36205ff4b5e5de39e37f9f22300c1.zip
libreoffice: add nix shells for source generation
Diffstat (limited to 'pkgs/applications/office')
-rw-r--r--pkgs/applications/office/libreoffice/README.md10
-rw-r--r--pkgs/applications/office/libreoffice/default-gen-shell.nix27
-rw-r--r--pkgs/applications/office/libreoffice/default-primary-src.nix17
-rw-r--r--pkgs/applications/office/libreoffice/default.nix17
-rw-r--r--pkgs/applications/office/libreoffice/download-list-builder.sh3
-rwxr-xr-xpkgs/applications/office/libreoffice/generate-libreoffice-srcs.sh6
-rw-r--r--pkgs/applications/office/libreoffice/still-gen-shell.nix27
-rw-r--r--pkgs/applications/office/libreoffice/still-primary-src.nix17
-rw-r--r--pkgs/applications/office/libreoffice/still.nix17
9 files changed, 116 insertions, 25 deletions
diff --git a/pkgs/applications/office/libreoffice/README.md b/pkgs/applications/office/libreoffice/README.md
new file mode 100644
index 000000000000..eb21fe2f441e
--- /dev/null
+++ b/pkgs/applications/office/libreoffice/README.md
@@ -0,0 +1,10 @@
+LibreOffice
+===========
+
+To generate `libreoffice-srcs.nix`:
+
+    nix-shell default-gen-shell.nix --run generate
+
+To generate `libreoffice-srcs-still.nix`:
+
+    nix-shell still-gen-shell.nix --run generate
diff --git a/pkgs/applications/office/libreoffice/default-gen-shell.nix b/pkgs/applications/office/libreoffice/default-gen-shell.nix
new file mode 100644
index 000000000000..c3cb23d86395
--- /dev/null
+++ b/pkgs/applications/office/libreoffice/default-gen-shell.nix
@@ -0,0 +1,27 @@
+{ pkgs ? (import <nixpkgs> {}) }:
+
+with pkgs;
+
+let
+
+  primary-src = callPackage ./default-primary-src.nix {};
+
+in
+
+stdenv.mkDerivation {
+  name = "generate-libreoffice-srcs-shell";
+
+  buildCommand = "exit 1";
+
+  downloadList = stdenv.mkDerivation {
+    name = "libreoffice-${primary-src.version}-download-list";
+    inherit (primary-src) src version;
+    builder = ./download-list-builder.sh;
+  };
+
+  shellHook = ''
+    function generate {
+      ./generate-libreoffice-srcs.sh | tee libreoffice-srcs.nix
+    }
+  '';
+}
diff --git a/pkgs/applications/office/libreoffice/default-primary-src.nix b/pkgs/applications/office/libreoffice/default-primary-src.nix
new file mode 100644
index 000000000000..2af9e4337893
--- /dev/null
+++ b/pkgs/applications/office/libreoffice/default-primary-src.nix
@@ -0,0 +1,17 @@
+{ fetchurl }:
+
+rec {
+  major = "5";
+  minor = "2";
+  patch = "1";
+  tweak = "2";
+
+  subdir = "${major}.${minor}.${patch}";
+
+  version = "${subdir}${if tweak == "" then "" else "."}${tweak}";
+
+  src = fetchurl {
+    url = "http://download.documentfoundation.org/libreoffice/src/${subdir}/libreoffice-${version}.tar.xz";
+    sha256 = "14g2xwpid4vsgmc69rs7hz1wx96dfkq0cbm32vjgljsm7a19qfc1";
+  };
+}
diff --git a/pkgs/applications/office/libreoffice/default.nix b/pkgs/applications/office/libreoffice/default.nix
index 88a9a6baf147..d929bc99b101 100644
--- a/pkgs/applications/office/libreoffice/default.nix
+++ b/pkgs/applications/office/libreoffice/default.nix
@@ -19,14 +19,14 @@
 }:
 
 let
+  primary-src = import ./default-primary-src.nix { inherit fetchurl; };
+in
+
+with { inherit (primary-src) major minor subdir version; };
+
+let
   lib = stdenv.lib;
   langsSpaces = lib.concatStringsSep " " langs;
-  major = "5";
-  minor = "2";
-  patch = "1";
-  tweak = "2";
-  subdir = "${major}.${minor}.${patch}";
-  version = "${subdir}${if tweak == "" then "" else "."}${tweak}";
 
   fetchThirdParty = {name, md5, brief, subDir ? ""}: fetchurl {
     inherit name md5;
@@ -64,10 +64,7 @@ let
 in stdenv.mkDerivation rec {
   name = "libreoffice-${version}";
 
-  src = fetchurl {
-    url = "http://download.documentfoundation.org/libreoffice/src/${subdir}/libreoffice-${version}.tar.xz";
-    sha256 = "14g2xwpid4vsgmc69rs7hz1wx96dfkq0cbm32vjgljsm7a19qfc1";
-  };
+  inherit (primary-src) src;
 
   # Openoffice will open libcups dynamically, so we link it directly
   # to make its dlopen work.
diff --git a/pkgs/applications/office/libreoffice/download-list-builder.sh b/pkgs/applications/office/libreoffice/download-list-builder.sh
new file mode 100644
index 000000000000..c054e2c72cbe
--- /dev/null
+++ b/pkgs/applications/office/libreoffice/download-list-builder.sh
@@ -0,0 +1,3 @@
+source $stdenv/setup
+
+tar --extract --file=$src libreoffice-$version/download.lst -O > $out
diff --git a/pkgs/applications/office/libreoffice/generate-libreoffice-srcs.sh b/pkgs/applications/office/libreoffice/generate-libreoffice-srcs.sh
index 2367fa1c7f44..82c5013f1607 100755
--- a/pkgs/applications/office/libreoffice/generate-libreoffice-srcs.sh
+++ b/pkgs/applications/office/libreoffice/generate-libreoffice-srcs.sh
@@ -2,10 +2,6 @@
 
 # Ideally we would move as much as possible into derivation dependencies
 
-# Take the list of files from the main package, ooo.lst.in
-
-# This script wants an argument: download list file
-
 cat <<EOF
 [
 EOF
@@ -22,7 +18,7 @@ write_entry(){
 }
 
 saved_line=
-cat "$(dirname "$0")/libreoffice-srcs-additions.sh" "$@" |
+cat "$(dirname "$0")/libreoffice-srcs-additions.sh" "$downloadList" |
 while read line; do
   case "$line" in
     EVAL\ *)
diff --git a/pkgs/applications/office/libreoffice/still-gen-shell.nix b/pkgs/applications/office/libreoffice/still-gen-shell.nix
new file mode 100644
index 000000000000..991492e2d986
--- /dev/null
+++ b/pkgs/applications/office/libreoffice/still-gen-shell.nix
@@ -0,0 +1,27 @@
+{ pkgs ? (import <nixpkgs> {}) }:
+
+with pkgs;
+
+let
+
+  primary-src = callPackage ./still-primary-src.nix {};
+
+in
+
+stdenv.mkDerivation {
+  name = "generate-libreoffice-srcs-shell";
+
+  buildCommand = "exit 1";
+
+  downloadList = stdenv.mkDerivation {
+    name = "libreoffice-${primary-src.version}-download-list";
+    inherit (primary-src) src version;
+    builder = ./download-list-builder.sh;
+  };
+
+  shellHook = ''
+    function generate {
+      ./generate-libreoffice-srcs.sh | tee libreoffice-srcs-still.nix
+    }
+  '';
+}
diff --git a/pkgs/applications/office/libreoffice/still-primary-src.nix b/pkgs/applications/office/libreoffice/still-primary-src.nix
new file mode 100644
index 000000000000..33ba558ed298
--- /dev/null
+++ b/pkgs/applications/office/libreoffice/still-primary-src.nix
@@ -0,0 +1,17 @@
+{ fetchurl }:
+
+rec {
+  major = "5";
+  minor = "1";
+  patch = "5";
+  tweak = "2";
+
+  subdir = "${major}.${minor}.${patch}";
+
+  version = "${subdir}${if tweak == "" then "" else "."}${tweak}";
+
+  src = fetchurl {
+    url = "http://download.documentfoundation.org/libreoffice/src/${subdir}/libreoffice-${version}.tar.xz";
+    sha256 = "1qg0dj0zwh5ifhmvv4k771nmyqddz4ifn75s9mr1p0nyix8zks8x";
+  };
+}
diff --git a/pkgs/applications/office/libreoffice/still.nix b/pkgs/applications/office/libreoffice/still.nix
index 2b3d4ad2ec6e..383e43a74aad 100644
--- a/pkgs/applications/office/libreoffice/still.nix
+++ b/pkgs/applications/office/libreoffice/still.nix
@@ -19,14 +19,14 @@
 }:
 
 let
+  primary-src = import ./still-primary-src.nix { inherit fetchurl; };
+in
+
+with { inherit (primary-src) major minor subdir version; };
+
+let
   lib = stdenv.lib;
   langsSpaces = lib.concatStringsSep " " langs;
-  major = "5";
-  minor = "1";
-  patch = "5";
-  tweak = "2";
-  subdir = "${major}.${minor}.${patch}";
-  version = "${subdir}${if tweak == "" then "" else "."}${tweak}";
 
   fetchThirdParty = {name, md5, brief, subDir ? ""}: fetchurl {
     inherit name md5;
@@ -64,10 +64,7 @@ let
 in stdenv.mkDerivation rec {
   name = "libreoffice-${version}";
 
-  src = fetchurl {
-    url = "http://download.documentfoundation.org/libreoffice/src/${subdir}/libreoffice-${version}.tar.xz";
-    sha256 = "1qg0dj0zwh5ifhmvv4k771nmyqddz4ifn75s9mr1p0nyix8zks8x";
-  };
+  inherit (primary-src) src;
 
   # we only have this problem on i686 ATM
   patches = if stdenv.is64bit then null else [