From f13331ad05831002443a7743cbd0732bf17939e7 Mon Sep 17 00:00:00 2001 From: Jacek Konieczny Date: Sat, 20 Feb 2016 15:49:22 +0100 Subject: [PATCH 1/1] new package Probably still some cleanup needed. --- CMakeLists.patch | 11 +++++ LunarGLASS.spec | 116 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 127 insertions(+) create mode 100644 CMakeLists.patch create mode 100644 LunarGLASS.spec diff --git a/CMakeLists.patch b/CMakeLists.patch new file mode 100644 index 0000000..2ebef7a --- /dev/null +++ b/CMakeLists.patch @@ -0,0 +1,11 @@ +--- LunarGLASS-55f8dd9b8628c0a14772e17be2e90a9ded1a75e5/CMakeLists.txt~ 2016-02-16 23:14:26.000000000 +0100 ++++ LunarGLASS-55f8dd9b8628c0a14772e17be2e90a9ded1a75e5/CMakeLists.txt 2016-02-18 21:59:40.857742867 +0100 +@@ -49,7 +49,7 @@ + # Get system library dependencies from llvm-config. + execute_process(COMMAND ${LLVM_BUILD}/install/usr/local/bin/llvm-config --ldflags OUTPUT_VARIABLE LLVM_LD_FLAGS) + # Convert to a list of link flags. +- string(REPLACE " " ";" LLVM_LD_FLAGS_LIST ${LLVM_LD_FLAGS}) ++ string(REPLACE " " ";" LLVM_LD_FLAGS_LIST "${LLVM_LD_FLAGS}") + foreach(LIB ${LLVM_LD_FLAGS_LIST}) + if (${LIB} MATCHES "^-l") + # Get the library's name. diff --git a/LunarGLASS.spec b/LunarGLASS.spec new file mode 100644 index 0000000..7301f4a --- /dev/null +++ b/LunarGLASS.spec @@ -0,0 +1,116 @@ +# +# Conditional build: +%bcond_with tests # build with tests + +%define snap 20160216 +%define commit 55f8dd9b8628c0a14772e17be2e90a9ded1a75e5 +%define rel 0.1 + +%define llvm_version 3.4.2 + +Summary: LLVM IR and optimizer for shaders, including front-end adapters for GLSL and SPIR-V and back-end adapter for GLSL +Name: LunarGLASS +Version: 0 +Release: 0.%{snap}.%{rel} +License: BSD-like +Group: Libraries +Source0: https://github.com/LunarG/LunarGLASS/archive/%{commit}/%{name}-%{snap}.tar.gz +# Source0-md5: d05a3f5a2412d525bb76bf8868ee5c35 +Source1: http://llvm.org/releases/%{llvm_version}/llvm-%{llvm_version}.src.tar.gz +# Source1-md5: a20669f75967440de949ac3b1bad439c +Patch0: CMakeLists.patch +URL: https://github.com/LunarG/LunarGLASS/ +BuildRequires: clang +BuildRequires: cmake +BuildRequires: glslang-devel +BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) + +%description +LunarGLASS is an LLVM-based shader-compiler stack available to +open-source devel opers. It brings a new approach by splitting the +common shared intermediate repr esentation (IR) into two levels; the +top level is completely platform independen t while the bottom level +is dynamically tailorable to different families of arch itecture. Both +levels still lend themselves to portability and sharing of tools. +Together, they solve the problem of having a standard portable IR +without being biased toward a specific class of target architecture. + +LunarGLASS is a long-term compiler stack architecture, based on +establishing com mon intermediate representations (IRs) allowing +modularity between stack layers. Each source-language front end would +benefit from a common set of high- and mid +- -level optimizations, as would each back end, without the need to + invent additio nal IRs. The short-term goal is to leverage investments + in existing IRs while th e long-term goal is to reduce the number of + IRs and not require optimization dif ficulties caused by losing + information going through an IR. + +%package devel +Summary: Header files for %{name} library +Summary(pl.UTF-8): Pliki nagłówkowe biblioteki %{name} +Group: Development/Libraries + +%description devel +Header files for %{name} library. + +%description devel -l pl.UTF-8 +Pliki nagłówkowe biblioteki %{name}. + +%prep +%setup -qn %{name}-%{commit} +%patch0 -p1 + +cd Core/LLVM/llvm-3.4 +tar -x --strip-components=1 --skip-old-files -f %{SOURCE1} +cd ../../.. + +%build +cd Core/LLVM/llvm-3.4 +install -d build +cd build +../%%configure + +%{__make} +%{__make} install prefix=%{_prefix}/local DESTDIR=`pwd`/install + +cd ../../../.. + +install -d build +cd build +%cmake \ + -DGLSLANGINCLUDES=%{_includedir}/glslang \ + -DGLSLANGLIBS=%{_libdir} \ + ../ +%{__make} + +%{?with_tests:%{__make} test} + +%install +rm -rf $RPM_BUILD_ROOT + +install -d $RPM_BUILD_ROOT{%{_bindir},%{_libdir}} + +cd build +%{__make} install + +cp -p install/bin/LunarGOO $RPM_BUILD_ROOT%{_bindir} +cp -p install/lib/*.a $RPM_BUILD_ROOT%{_libdir} + +cd .. + +for path in $(find * -name '*.h') ; do + install -D $path $RPM_BUILD_ROOT%{_includedir}/%{name}/$path +done + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(644,root,root,755) +%doc Readme.md Todo.txt +%attr(755,root,root) %{_bindir}/LunarGOO + +%files devel +%defattr(644,root,root,755) +%{_libdir}/*.a +%{_includedir}/%{name} -- 2.44.0