about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libelfin
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-06-12 09:59:45 +0000
committerAlyssa Ross <hi@alyssa.is>2019-06-18 18:14:17 +0000
commitc5571a126859eb658ffd7340cb580f7d91f12bb6 (patch)
tree577573c3bf14d9849246d52daece719a10eaf138 /nixpkgs/pkgs/development/libraries/libelfin
parent828bd4e8ddcbcd354ddfd99f55af69ee8ff5d9e7 (diff)
parent98e3b90b6c8f400ae5438ef868eb992a64b75ce5 (diff)
downloadnixlib-c5571a126859eb658ffd7340cb580f7d91f12bb6.tar
nixlib-c5571a126859eb658ffd7340cb580f7d91f12bb6.tar.gz
nixlib-c5571a126859eb658ffd7340cb580f7d91f12bb6.tar.bz2
nixlib-c5571a126859eb658ffd7340cb580f7d91f12bb6.tar.lz
nixlib-c5571a126859eb658ffd7340cb580f7d91f12bb6.tar.xz
nixlib-c5571a126859eb658ffd7340cb580f7d91f12bb6.tar.zst
nixlib-c5571a126859eb658ffd7340cb580f7d91f12bb6.zip
Merge commit '98e3b90b6c8f400ae5438ef868eb992a64b75ce5'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libelfin')
-rw-r--r--nixpkgs/pkgs/development/libraries/libelfin/0001-Don-t-detect-package-version-with-Git.patch72
-rw-r--r--nixpkgs/pkgs/development/libraries/libelfin/default.nix32
2 files changed, 104 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libelfin/0001-Don-t-detect-package-version-with-Git.patch b/nixpkgs/pkgs/development/libraries/libelfin/0001-Don-t-detect-package-version-with-Git.patch
new file mode 100644
index 000000000000..e4b4e592b7a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libelfin/0001-Don-t-detect-package-version-with-Git.patch
@@ -0,0 +1,72 @@
+From 77a34d31695e02bc3d06b68c7ca3ff9c3cb67844 Mon Sep 17 00:00:00 2001
+From: Maximilian Bosch <maximilian@mbosch.me>
+Date: Sun, 26 May 2019 19:46:27 +0200
+Subject: [PATCH] Don't detect package version with Git
+
+This will build in a Nix-based build environment. Instead we ismply
+replace `@version@` using `substituteAll`.
+---
+ dwarf/Makefile | 19 +++++++++----------
+ elf/Makefile   | 15 +++++++--------
+ 2 files changed, 16 insertions(+), 18 deletions(-)
+
+diff --git a/dwarf/Makefile b/dwarf/Makefile
+index 71456bd..f871227 100644
+--- a/dwarf/Makefile
++++ b/dwarf/Makefile
+@@ -43,16 +43,15 @@ CLEAN += libdwarf++.so
+ # Create pkg-config for local library and headers. This will be
+ # transformed in to the correct global pkg-config by install.
+ libdwarf++.pc: always
+-	@(VER=$$(git describe --match 'v*' | sed -e s/^v//); \
+-	  echo "libdir=$$PWD"; \
+-	  echo "includedir=$$PWD"; \
+-	  echo ""; \
+-	  echo "Name: libdwarf++"; \
+-	  echo "Description: C++11 DWARF library"; \
+-	  echo "Version: $$VER"; \
+-	  echo "Requires: libelf++ = $$VER"; \
+-	  echo "Libs: -L\$${libdir} -ldwarf++"; \
+-	  echo "Cflags: -I\$${includedir}") > $@
++	@(echo "libdir=$$PWD"; \
++		echo "includedir=$$PWD"; \
++		echo ""; \
++		echo "Name: libdwarf++"; \
++		echo "Description: C++11 DWARF library"; \
++		echo "Version: @version@"; \
++		echo "Requires: libelf++ = @version@"; \
++		echo "Libs: -L\$${libdir} -ldwarf++"; \
++		echo "Cflags: -I\$${includedir}") > $@
+ CLEAN += libdwarf++.pc
+ 
+ .PHONY: always
+diff --git a/elf/Makefile b/elf/Makefile
+index 9c7c224..50630a7 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -42,15 +42,14 @@ CLEAN += libelf++.so
+ # Create pkg-config for local library and headers. This will be
+ # transformed in to the correct global pkg-config by install.
+ libelf++.pc: always
+-	@(VER=$$(git describe --match 'v*' | sed -e s/^v//); \
+-	  echo "libdir=$$PWD"; \
++	@(echo "libdir=$$PWD"; \
+ 	  echo "includedir=$$PWD"; \
+-	  echo ""; \
+-	  echo "Name: libelf++"; \
+-	  echo "Description: C++11 ELF library"; \
+-	  echo "Version: $$VER"; \
+-	  echo "Libs: -L\$${libdir} -lelf++"; \
+-	  echo "Cflags: -I\$${includedir}") > $@
++		echo ""; \
++		echo "Name: libelf++"; \
++		echo "Description: C++11 ELF library"; \
++		echo "Version: @version@"; \
++		echo "Libs: -L\$${libdir} -lelf++"; \
++		echo "Cflags: -I\$${includedir}") > $@
+ CLEAN += libelf++.pc
+ 
+ .PHONY: always
+-- 
+2.19.2
+
diff --git a/nixpkgs/pkgs/development/libraries/libelfin/default.nix b/nixpkgs/pkgs/development/libraries/libelfin/default.nix
new file mode 100644
index 000000000000..2eb1bd0e4fc4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libelfin/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, python3, substituteAll }:
+
+stdenv.mkDerivation rec {
+  pname = "libelfin";
+  version = "unstable-2018-08-25";
+
+  src = fetchFromGitHub {
+    owner = "aclements";
+    repo = pname;
+    rev = "ac45a094fadba77ad840063fb7aab82571546be0";
+    sha256 = "143x680c6hsy51kngs04ypg4ql3lp498llcwj4lh1v0qp5qvjhyz";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./0001-Don-t-detect-package-version-with-Git.patch;
+      inherit version;
+    })
+  ];
+
+  nativeBuildInputs = [ python3 ];
+
+  makeFlags = [ "PREFIX=${placeholder "out"}" ];
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/aclements/libelfin/;
+    license = licenses.mit;
+    description = "C++11 ELF/DWARF parser";
+    maintainers = with maintainers; [ ma27 ];
+    platforms = platforms.linux;
+  };
+}