2
0
Fork 0
Genode Packages collection https://git.sr.ht/~ehmry/genodepkgs/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

63 lines
1.6 KiB

{ preparePort, nixpkgs, upstream }:
let
version = "11.2.2";
upstreamMesaDir = "${upstream.src}/repos/libports/src/lib/mesa";
in
preparePort {
name = "mesa-${version}";
outputs = [ "source" "dev" ];
depsBuildBuild = with nixpkgs.buildPackages; [ bison flex python ];
src = nixpkgs.fetchurl {
url = "https://mesa.freedesktop.org/archive/older-versions/11.x/${version}/mesa-${version}.tar.gz";
sha256 = "e2453014cd2cc5337a5180cdeffe8cf24fffbb83e20a96888e2b01df868eaae6";
};
tarFlags = "--files-from ${upstreamMesaDir}/files.list";
patches = "${upstreamMesaDir}/patches/*.patch";
patchFlags = "-p4";
installPhase =
''
mkdir -p $pkgconfigdir
pushd src/compiler/glsl
bison -o glsl_parser.cpp -p "_mesa_glsl_" \
--defines=glsl_parser.h glsl_parser.yy
flex -o glsl_lexer.cpp glsl_lexer.ll
pushd glcpp
bison -o sglcpp-parse.c \
-p "glcpp_parser_" --defines=glcpp-parse.h \
glcpp-parse.y
flex -o glcpp-lex.c glcpp-lex.l
popd
popd
pushd src/mesa/program
bison -o program_parse.tab.c \
-p "_mesa_program_" --defines=program_parse.tab.h \
program_parse.y
flex -o lex.yy.c program_lexer.l
popd
mkdir -p src/mapi/shared-glapi
pushd src/mapi/shared-glapi
python ../mapi_abi.py --mode lib --printer shared-glapi \
../glapi/gen/gl_and_es_API.xml > glapi_mapi_tmp.h
popd
mv include $includedir
substituteAll ${./mesa.pc.in} $pkgconfigdir/mesa.pc
mkdir $source
mv * $source/
'';
}