commit
ac6a4f7cf5
@ -1,15 +1,17 @@ |
||||
# pkgs.mkShell {#sec-pkgs-mkShell} |
||||
|
||||
`pkgs.mkShell` is a special kind of derivation that is only useful when using it combined with `nix-shell`. It will in fact fail to instantiate when invoked with `nix-build`. |
||||
`pkgs.mkShell` is a special kind of derivation that is only useful when using |
||||
it combined with `nix-shell`. It will in fact fail to instantiate when invoked |
||||
with `nix-build`. |
||||
|
||||
## Usage {#sec-pkgs-mkShell-usage} |
||||
|
||||
```nix |
||||
{ pkgs ? import <nixpkgs> {} }: |
||||
pkgs.mkShell { |
||||
# this will make all the build inputs from hello and gnutar |
||||
# available to the shell environment |
||||
# specify which packages to add to the shell environment |
||||
packages = [ pkgs.gnumake ]; |
||||
# add all the dependencies, of the given packages, to the shell environment |
||||
inputsFrom = with pkgs; [ hello gnutar ]; |
||||
buildInputs = [ pkgs.gnumake ]; |
||||
} |
||||
``` |
||||
|
@ -0,0 +1,49 @@ |
||||
{ lib |
||||
, buildPythonPackage |
||||
, fetchFromGitHub |
||||
, isPy3k |
||||
, libGL |
||||
, libX11 |
||||
, pytestCheckHook |
||||
, psutil |
||||
}: |
||||
|
||||
buildPythonPackage rec { |
||||
pname = "glcontext"; |
||||
version = "2.3.3"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "moderngl"; |
||||
repo = pname; |
||||
rev = version; |
||||
sha256 = "16kwrfjijn9bnb48rk17wapmhxq6g9s59zczh65imyncb9k82wkc"; |
||||
}; |
||||
|
||||
disabled = !isPy3k; |
||||
|
||||
buildInputs = [ libGL libX11 ]; |
||||
|
||||
postPatch = '' |
||||
substituteInPlace glcontext/x11.cpp \ |
||||
--replace '"libGL.so"' '"${libGL}/lib/libGL.so"' \ |
||||
--replace '"libX11.so"' '"${libX11}/lib/libX11.so"' |
||||
substituteInPlace glcontext/egl.cpp \ |
||||
--replace '"libGL.so"' '"${libGL}/lib/libGL.so"' \ |
||||
--replace '"libEGL.so"' '"${libGL}/lib/libEGL.so"' |
||||
''; |
||||
|
||||
# Tests fail because they try to open display. See |
||||
# https://github.com/NixOS/nixpkgs/pull/121439 |
||||
# for details. |
||||
doCheck = false; |
||||
|
||||
pythonImportsCheck = [ "glcontext" ]; |
||||
|
||||
meta = with lib; { |
||||
homepage = "https://github.com/moderngl/glcontext"; |
||||
description = "OpenGL implementation for ModernGL"; |
||||
license = licenses.mit; |
||||
platforms = platforms.linux; |
||||
maintainers = with maintainers; [ friedelino ]; |
||||
}; |
||||
} |
Loading…
Reference in new issue