mirror of
https://github.com/ivabus/pantry
synced 2024-11-10 02:25:18 +03:00
geuz.org/gl2ps (#3352)
* new file: projects/geuz.org/gl2ps/package.yml new file: projects/geuz.org/gl2ps/test_darwin.c new file: projects/geuz.org/gl2ps/test_linux.c * wip
This commit is contained in:
parent
15474e02de
commit
cf2b067f7a
41
projects/geuz.org/gl2ps/package.yml
Normal file
41
projects/geuz.org/gl2ps/package.yml
Normal file
|
@ -0,0 +1,41 @@
|
|||
distributable:
|
||||
url: https://geuz.org/gl2ps/src/gl2ps-{{version}}.tgz
|
||||
strip-components: 1
|
||||
versions:
|
||||
url: https://geuz.org/gl2ps/src/
|
||||
match: /gl2ps-\d+\.\d+\.\d+\.tgz/
|
||||
strip:
|
||||
- /^gl2ps-/
|
||||
- /\.tgz/
|
||||
dependencies:
|
||||
libpng.org: '*'
|
||||
linux:
|
||||
freeglut.sourceforge.io: '*'
|
||||
build:
|
||||
dependencies:
|
||||
tea.xyz/gx/cc: c99
|
||||
tea.xyz/gx/make: '*'
|
||||
cmake.org: '*'
|
||||
script:
|
||||
- cmake . $CMAKE_ARGS
|
||||
- make --jobs {{ hw.concurrency }} install
|
||||
env:
|
||||
CMAKE_ARGS:
|
||||
- -DCMAKE_INSTALL_PREFIX="{{prefix}}
|
||||
- -DCMAKE_INSTALL_LIBDIR=lib
|
||||
- -DCMAKE_BUILD_TYPE=Release
|
||||
- -DCMAKE_FIND_FRAMEWORK=LAST
|
||||
- -DCMAKE_VERBOSE_MAKEFILE=ON
|
||||
- -Wno-dev
|
||||
- -DBUILD_TESTING=OFF
|
||||
test:
|
||||
dependencies:
|
||||
tea.xyz/gx/cc: c99
|
||||
script:
|
||||
- run: cc -lgl2ps -framework OpenGL -framework GLUT -framework Cocoa test_darwin.c -o testfile
|
||||
if: darwin
|
||||
- run: cc -lgl2ps -lglut -lGL test_linux.c -o testfile
|
||||
if: linux
|
||||
# - ./testfile
|
||||
# We cannot run ./testfile due to the absence of a display.
|
||||
- ls . | grep testfile
|
28
projects/geuz.org/gl2ps/test_darwin.c
Normal file
28
projects/geuz.org/gl2ps/test_darwin.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
#include <GLUT/glut.h>
|
||||
#include <gl2ps.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitDisplayMode(GLUT_DEPTH);
|
||||
glutInitWindowSize(400, 400);
|
||||
glutInitWindowPosition(100, 100);
|
||||
glutCreateWindow(argv[0]);
|
||||
GLint viewport[4];
|
||||
glGetIntegerv(GL_VIEWPORT, viewport);
|
||||
FILE *fp = fopen("test.eps", "wb");
|
||||
GLint buffsize = 0, state = GL2PS_OVERFLOW;
|
||||
while( state == GL2PS_OVERFLOW ){
|
||||
buffsize += 1024*1024;
|
||||
gl2psBeginPage ( "Test", "Tea", viewport,
|
||||
GL2PS_EPS, GL2PS_BSP_SORT, GL2PS_SILENT |
|
||||
GL2PS_SIMPLE_LINE_OFFSET | GL2PS_NO_BLENDING |
|
||||
GL2PS_OCCLUSION_CULL | GL2PS_BEST_ROOT,
|
||||
GL_RGBA, 0, NULL, 0, 0, 0, buffsize,
|
||||
fp, "test.eps" );
|
||||
gl2psText("Tea Test", "Courier", 12);
|
||||
state = gl2psEndPage();
|
||||
}
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
28
projects/geuz.org/gl2ps/test_linux.c
Normal file
28
projects/geuz.org/gl2ps/test_linux.c
Normal file
|
@ -0,0 +1,28 @@
|
|||
#include <GL/glut.h>
|
||||
#include <gl2ps.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
glutInit(&argc, argv);
|
||||
glutInitDisplayMode(GLUT_DEPTH);
|
||||
glutInitWindowSize(400, 400);
|
||||
glutInitWindowPosition(100, 100);
|
||||
glutCreateWindow(argv[0]);
|
||||
GLint viewport[4];
|
||||
glGetIntegerv(GL_VIEWPORT, viewport);
|
||||
FILE *fp = fopen("test.eps", "wb");
|
||||
GLint buffsize = 0, state = GL2PS_OVERFLOW;
|
||||
while( state == GL2PS_OVERFLOW ){
|
||||
buffsize += 1024*1024;
|
||||
gl2psBeginPage ( "Test", "Tea", viewport,
|
||||
GL2PS_EPS, GL2PS_BSP_SORT, GL2PS_SILENT |
|
||||
GL2PS_SIMPLE_LINE_OFFSET | GL2PS_NO_BLENDING |
|
||||
GL2PS_OCCLUSION_CULL | GL2PS_BEST_ROOT,
|
||||
GL_RGBA, 0, NULL, 0, 0, 0, buffsize,
|
||||
fp, "test.eps" );
|
||||
gl2psText("Tea Test", "Courier", 12);
|
||||
state = gl2psEndPage();
|
||||
}
|
||||
fclose(fp);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue