# --- SDE-COPYRIGHT-NOTE-BEGIN ---
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
# 
# Filename: package/.../glew/glew.conf
# Copyright (C) 2006 The OpenSDE Project
# 
# More information can be found in the files COPYING and README.
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License. A copy of the
# GNU General Public License can be found in the file COPYING.
# --- SDE-COPYRIGHT-NOTE-END ---

# fixing all the hardcoded paths, since headers go to include/GL makes sense
# for glew to be relative to xorg

glew_main() {
	sed -i -e 's,$(GLEW_DEST)/lib,'$( pkgprefix libdir xorg-server)',g' \
	-i -e 's,$(GLEW_DEST)/bin,'$( pkgprefix bindir xorg-server )',g' \
	-i -e 's,=? /usr,=? '$root$prefix',g' Makefile

	sed -i -e 's,-L/usr/X11R6/lib,`pkg-config x11 --libs-only-L`,g' config/Makefile.linux

}

hook_add premake 5 "glew_main"