summary refs log tree commit diff
path: root/pkgs/development/libraries/pystring
diff options
context:
space:
mode:
authorMaxwell Beck <max@ryt.one>2021-06-19 22:14:25 -0500
committerMaxwell Beck <max@ryt.one>2021-06-19 23:00:05 -0500
commit6d45afda00257f0ae75f31a2b597181247190af0 (patch)
tree21764592199db8c60c5217e1c527e9fe7246fd22 /pkgs/development/libraries/pystring
parent7e83a040fa2843e36b201c6d79ad118e9192b1a0 (diff)
downloadnixpkgs-6d45afda00257f0ae75f31a2b597181247190af0.tar
nixpkgs-6d45afda00257f0ae75f31a2b597181247190af0.tar.gz
nixpkgs-6d45afda00257f0ae75f31a2b597181247190af0.tar.bz2
nixpkgs-6d45afda00257f0ae75f31a2b597181247190af0.tar.lz
nixpkgs-6d45afda00257f0ae75f31a2b597181247190af0.tar.xz
nixpkgs-6d45afda00257f0ae75f31a2b597181247190af0.tar.zst
nixpkgs-6d45afda00257f0ae75f31a2b597181247190af0.zip
pystring: init at 1.1.3
Required for OpenColorIO 2.x
Diffstat (limited to 'pkgs/development/libraries/pystring')
-rw-r--r--pkgs/development/libraries/pystring/default.nix30
-rw-r--r--pkgs/development/libraries/pystring/makefile.patch26
2 files changed, 56 insertions, 0 deletions
diff --git a/pkgs/development/libraries/pystring/default.nix b/pkgs/development/libraries/pystring/default.nix
new file mode 100644
index 00000000000..df80bb773e3
--- /dev/null
+++ b/pkgs/development/libraries/pystring/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, fetchFromGitHub, libtool }:
+
+stdenv.mkDerivation rec {
+  pname = "pystring";
+  version = "1.1.3";
+
+  src = fetchFromGitHub {
+    owner = "imageworks";
+    repo = "pystring";
+    rev = "v${version}";
+    sha256 = "1w31pjiyshqgk6zd6m3ab3xfgb0ribi77r6fwrry2aw8w1adjknf";
+  };
+
+  nativeBuildInputs = [ libtool ];
+
+  patches = [ ./makefile.patch ];
+
+  doCheck = true;
+  checkTarget = "test";
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/imageworks/pystring/";
+    description = "A collection of C++ functions which match the interface and behavior of python's string class methods using std::string";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.rytone ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/pystring/makefile.patch b/pkgs/development/libraries/pystring/makefile.patch
new file mode 100644
index 00000000000..0bbd6522d39
--- /dev/null
+++ b/pkgs/development/libraries/pystring/makefile.patch
@@ -0,0 +1,26 @@
+--- pystring/Makefile.orig	2020-02-04 03:24:44.000000000 -0300
++++ pystring/Makefile	2020-11-20 20:23:07.314247959 -0300
+@@ -1,7 +1,9 @@
+-LIBTOOL = libtool
+-LIBDIR = /usr/lib
+-CXX = g++
+-CXXFLAGS = -g -O3 -Wall -Wextra -Wshadow -Wconversion -Wcast-qual -Wformat=2
++LIBTOOL ?= libtool
++PREFIX ?= /usr
++INCLUDEDIR = ${PREFIX}/include/pystring
++LIBDIR = ${PREFIX}/lib
++CXX ?= g++
++CXXFLAGS ?= -g -O3 -Wall -Wextra -Wshadow -Wconversion -Wcast-qual -Wformat=2 -fPIC
+ 
+ all: libpystring.la
+ 
+@@ -12,7 +14,8 @@
+ 	$(LIBTOOL) --mode=link --tag=CXX $(CXX) -o $@ $< -rpath $(LIBDIR)
+ 
+ install: libpystring.la
+-	$(LIBTOOL) --mode=install install -c $< $(LIBDIR)/$<
++	$(LIBTOOL) --mode=install install -Dm755 $< $(DESTDIR)$(LIBDIR)/$<
++	$(LIBTOOL) --mode=install install -Dm644 pystring.h $(DESTDIR)$(INCLUDEDIR)/pystring.h
+ 
+ clean:
+ 	$(RM) -fr pystring.lo pystring.o libpystring.la .libs