From 1a773a84fc52939483681778cb511a7bea7903fb Mon Sep 17 00:00:00 2001 From: Chris Ostrouchov Date: Fri, 26 Oct 2018 11:23:47 -0400 Subject: [PATCH] pythonPackages.pyopengl: refactor move to python-modules --- .../python-modules/pyopengl/default.nix | 50 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 39 +-------------- 2 files changed, 51 insertions(+), 38 deletions(-) create mode 100644 pkgs/development/python-modules/pyopengl/default.nix diff --git a/pkgs/development/python-modules/pyopengl/default.nix b/pkgs/development/python-modules/pyopengl/default.nix new file mode 100644 index 000000000000..11a51f354d9f --- /dev/null +++ b/pkgs/development/python-modules/pyopengl/default.nix @@ -0,0 +1,50 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, pkgs +, pillow +}: + +buildPythonPackage rec { + pname = "pyopengl"; + version = "3.1.0"; + + src = fetchPypi { + inherit pname version; + sha256 = "9b47c5c3a094fa518ca88aeed35ae75834d53e4285512c61879f67a48c94ddaf"; + }; + + propagatedBuildInputs = [ pkgs.libGLU_combined pkgs.freeglut pillow ]; + + patchPhase = let + ext = stdenv.hostPlatform.extensions.sharedLibrary; in '' + substituteInPlace OpenGL/platform/glx.py \ + --replace "'GL'" "'${pkgs.libGL}/lib/libGL${ext}'" \ + --replace "'GLU'" "'${pkgs.libGLU}/lib/libGLU${ext}'" \ + --replace "'glut'" "'${pkgs.freeglut}/lib/libglut${ext}'" + substituteInPlace OpenGL/platform/darwin.py \ + --replace "'OpenGL'" "'${pkgs.libGL}/lib/libGL${ext}'" \ + --replace "'GLUT'" "'${pkgs.freeglut}/lib/libglut${ext}'" + ''; + + # Need to fix test runner + # Tests have many dependencies + # Extension types could not be found. + # Should run test suite from $out/${python.sitePackages} + doCheck = false; + + meta = with stdenv.lib; { + homepage = http://pyopengl.sourceforge.net/; + description = "PyOpenGL, the Python OpenGL bindings"; + longDescription = '' + PyOpenGL is the cross platform Python binding to OpenGL and + related APIs. The binding is created using the standard (in + Python 2.5) ctypes library, and is provided under an extremely + liberal BSD-style Open-Source license. + ''; + license = "BSD-style"; + platforms = platforms.mesaPlatforms; + }; + + +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 81489bb9e995..22be84dc8cdf 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3471,44 +3471,7 @@ in { pypdf2 = callPackage ../development/python-modules/pypdf2 { }; - pyopengl = buildPythonPackage rec { - name = "pyopengl-${version}"; - version = "3.1.0"; - - src = pkgs.fetchurl { - url = "mirror://pypi/P/PyOpenGL/PyOpenGL-${version}.tar.gz"; - sha256 = "9b47c5c3a094fa518ca88aeed35ae75834d53e4285512c61879f67a48c94ddaf"; - }; - propagatedBuildInputs = [ pkgs.libGLU_combined pkgs.freeglut self.pillow ]; - patchPhase = let - ext = stdenv.hostPlatform.extensions.sharedLibrary; in '' - substituteInPlace OpenGL/platform/glx.py \ - --replace "'GL'" "'${pkgs.libGL}/lib/libGL${ext}'" \ - --replace "'GLU'" "'${pkgs.libGLU}/lib/libGLU${ext}'" \ - --replace "'glut'" "'${pkgs.freeglut}/lib/libglut${ext}'" - substituteInPlace OpenGL/platform/darwin.py \ - --replace "'OpenGL'" "'${pkgs.libGL}/lib/libGL${ext}'" \ - --replace "'GLUT'" "'${pkgs.freeglut}/lib/libglut${ext}'" - ''; - meta = { - homepage = http://pyopengl.sourceforge.net/; - description = "PyOpenGL, the Python OpenGL bindings"; - longDescription = '' - PyOpenGL is the cross platform Python binding to OpenGL and - related APIs. The binding is created using the standard (in - Python 2.5) ctypes library, and is provided under an extremely - liberal BSD-style Open-Source license. - ''; - license = "BSD-style"; - platforms = platforms.mesaPlatforms; - }; - - # Need to fix test runner - # Tests have many dependencies - # Extension types could not be found. - # Should run test suite from $out/${python.sitePackages} - doCheck = false; - }; + pyopengl = callPackage ../development/python-modules/pyopengl { }; pyopenssl = callPackage ../development/python-modules/pyopenssl { };