move libraries to libllvm and rename llvm-devel to libllvm-devel

also try to add a patch to fix bug #163 (http://bugs.openmamba.org/view.php?id=163) [release 3.1-2mamba;Tue Apr 29 2014]
This commit is contained in:
Silvan Calarco 2024-01-06 06:26:09 +01:00
parent 38b4836a2e
commit cc8c9317cf
4 changed files with 296 additions and 0 deletions

View File

@ -1,2 +1,5 @@
# llvm # llvm
The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
Despite its name, LLVM has little to do with traditional virtual machines, though it does provide helpful libraries that can be used to build them.

View File

@ -0,0 +1,30 @@
--- llvm-3.1.src/tools/llvm-config/llvm-config.cpp.orig 2012-07-20 20:40:27.421755571 +0200
+++ llvm-3.1.src/tools/llvm-config/llvm-config.cpp 2012-07-20 20:39:59.212062264 +0200
@@ -230,15 +230,15 @@
switch (DevelopmentTreeLayout) {
case MakefileStyle:
ActiveBinDir = ActiveObjRoot + "/" + LLVM_BUILDMODE + "/bin";
- ActiveLibDir = ActiveObjRoot + "/" + LLVM_BUILDMODE + "/lib";
+ ActiveLibDir = ActiveObjRoot + "/" + LLVM_BUILDMODE + "/lib/llvm";
break;
case CMakeStyle:
ActiveBinDir = ActiveObjRoot + "/bin";
- ActiveLibDir = ActiveObjRoot + "/lib";
+ ActiveLibDir = ActiveObjRoot + "/lib/llvm";
break;
case CMakeBuildModeStyle:
ActiveBinDir = ActiveObjRoot + "/bin/" + LLVM_BUILDMODE;
- ActiveLibDir = ActiveObjRoot + "/lib/" + LLVM_BUILDMODE;
+ ActiveLibDir = ActiveObjRoot + "/lib/llvm" + LLVM_BUILDMODE;
break;
}
@@ -249,7 +249,7 @@
ActivePrefix = CurrentExecPrefix;
ActiveIncludeDir = ActivePrefix + "/include";
ActiveBinDir = ActivePrefix + "/bin";
- ActiveLibDir = ActivePrefix + "/lib";
+ ActiveLibDir = ActivePrefix + "/lib/llvm";
ActiveIncludeOption = "-I" + ActiveIncludeDir;
}

View File

@ -0,0 +1,29 @@
diff -Nru llvm-3.1.src.orig/tools/clang/lib/Driver/ToolChains.cpp llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp
--- llvm-3.1.src.orig/tools/clang/lib/Driver/ToolChains.cpp 2012-05-12 02:16:02.000000000 +0200
+++ llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp 2014-04-29 22:05:47.116054539 +0200
@@ -1185,7 +1185,8 @@
static const char *const ARMLibDirs[] = { "/lib" };
static const char *const ARMTriples[] = {
"arm-linux-gnueabi",
- "arm-linux-androideabi"
+ "arm-linux-androideabi",
+ "arm-openmamba-linux-gnueabi"
};
static const char *const X86_64LibDirs[] = { "/lib64", "/lib" };
@@ -1193,6 +1194,7 @@
"x86_64-linux-gnu",
"x86_64-unknown-linux-gnu",
"x86_64-pc-linux-gnu",
+ "x86_64-openmamba-linux-gnu",
"x86_64-redhat-linux6E",
"x86_64-redhat-linux",
"x86_64-suse-linux",
@@ -1206,6 +1208,7 @@
"i686-pc-linux-gnu",
"i486-linux-gnu",
"i386-linux-gnu",
+ "i586-openmamba-linux-gnu",
"i686-redhat-linux",
"i586-redhat-linux",
"i386-redhat-linux",

234
llvm.spec Normal file
View File

@ -0,0 +1,234 @@
Name: llvm
Version: 3.1
Release: 2mamba
Summary: The Low Level Virtual Machine
Group: Development/Languages
Vendor: openmamba
Distribution: openmamba
Packager: Davide Madrisan <davide.madrisan@gmail.com>
URL: http://llvm.org/
Source0: http://llvm.org/releases/%{version}/llvm-%{version}.src.tar.gz
Source1: http://llvm.org/releases/%{version}/clang-%{version}.src.tar.gz
Patch0: %{name}-3.1-llvm-config.patch
Patch1: llvm-3.1-openmamba-triplet.patch
License: NCSA
## AUTOBUILDREQ-BEGIN
BuildRequires: gcc-c++
BuildRequires: glibc-devel
BuildRequires: libgcc
BuildRequires: libstdc++6-devel
BuildRequires: ocaml
BuildRequires: perl-devel
## AUTOBUILDREQ-END
BuildRequires: ocaml
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%description
The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
Despite its name, LLVM has little to do with traditional virtual machines, though it does provide helpful libraries that can be used to build them.
%package -n lib%{name}
Group: System/Libraries
Summary: Shared libraries for %{name}
%description -n lib%{name}
This package contains shared libraries for %{name}.
%package -n lib%{name}-devel
Summary: Libraries and header files for LLVM
Group: Development/Languages
Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release}
Provides: llvm-devel
Obsoletes: llvm-devel
Requires: libstdc++6-devel
%description -n lib%{name}-devel
The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
Despite its name, LLVM has little to do with traditional virtual machines, though it does provide helpful libraries that can be used to build them.
This package contains library and header files needed to develop new native programs that use the LLVM infrastructure.
%package clang
Summary: LLVM native C/C++/Objective-C compiler
Group: Development/Languages
Requires: gcc-c++
%description clang
Clang is an "LLVM native" C/C++/Objective-C compiler, which aims to deliver amazingly fast compiles, extremely useful error and warning messages and to provide a platform for building great source level tools.
The Clang Static Analyzer is a tool automatically finds bugs in your code, and is a great example of the sort of tool that can be built using the Clang frontend as a library to parse C/C++ code.
%package clang-devel
Summary: Libraries and header files for LLVM clang
Group: Development/Languages
Requires: %{name}-clang = %{?epoch:%epoch:}%{version}-%{release}
%description clang-devel
Clang is an "LLVM native" C/C++/Objective-C compiler, which aims to deliver amazingly fast compiles, extremely useful error and warning messages and to provide a platform for building great source level tools.
The Clang Static Analyzer is a tool automatically finds bugs in your code, and is a great example of the sort of tool that can be built using the Clang frontend as a library to parse C/C++ code.
This package contains header files for the Clang compiler.
%package ocaml
Summary: OCaml binding for LLVM
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
#Requires: ocaml-runtime
%description ocaml
OCaml binding for LLVM.
%package ocaml-devel
Summary: Development files for %{name}-ocaml
Group: Development/Libraries
Requires: lib%{name}-devel = %{?epoch:%epoch:}%{version}-%{release}
Requires: %{name}-ocaml = %{?epoch:%epoch:}%{version}-%{release}
Requires: ocaml
%description ocaml-devel
The %{name}-ocaml-devel package contains libraries and signature files
for developing applications that use %{name}-ocaml.
%prep
%setup -q -a1 -n llvm-%{version}.src
%patch0 -p1
%ifarch x86_64
sed -i "s|/lib/llvm|/%{_lib}/llvm|" tools/llvm-config/llvm-config.cpp
%endif
mv clang-%{version}.src tools/clang
%patch1 -p1
%build
%configure \
--libdir=%{_libdir}/%{name} \
--datadir=%{_libdir}/%{name} \
--disable-assertions \
--enable-debug-runtime \
--enable-jit \
--enable-shared \
--with-c-include-dirs=%{_includedir}:$(find %{_prefix}/lib/gcc/*/* -maxdepth 0 -type d)/include \
--with-cxx-include-root=$(find %{_includedir}/c++/* -maxdepth 0 -type d) \
--with-cxx-include-arch=%{_arch}-%{_vendor}-%{_os}
# --enable-doxygen
sed -i 's|(PROJ_prefix)/lib|(PROJ_prefix)/%{_lib}/%{name}|g' Makefile.config
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall
install -d %{buildroot}%{_sysconfdir}/ld.so.conf.d
cat >> %{buildroot}%{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf << EOF
%{_libdir}/llvm
EOF
# Static analyzer not installed by default:
# http://clang-analyzer.llvm.org/installation#OtherPlatforms
install -d %{buildroot}%{_libdir}/clang-analyzer
# create launchers
for f in scan-{build,view}; do
ln -s %{_libdir}/clang-analyzer/$f/$f %{buildroot}%{_bindir}/$f
done
( cd tools/clang/tools &&
cp -pr scan-{build,view} %{buildroot}%{_libdir}/clang-analyzer/ )
mv %{buildroot}%{_prefix}/docs/llvm ./llvm-extradocs
rm -f ./llvm-extradocs/*.tar.gz
rm -f ./llvm-extradocs/ocamldoc/html/*.tar.gz
install -d clang-extradocs
for f in LICENSE.TXT NOTES.txt README.txt; do
cp tools/clang/$f clang-extradocs/
done
#rm -rf tools/clang/docs/{doxygen*,Makefile*,*.graffle,tools}
rm %{buildroot}%{_libdir}/%{name}/*LLVMHello.*
find examples -name 'Makefile' | xargs -0r rm -f
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%{_bindir}/bugpoint
%{_bindir}/llc
%{_bindir}/lli
%{_bindir}/llvm*
%{_bindir}/macho-dump
%{_bindir}/c-index-test
%{_libdir}/ocaml/META.llvm
%exclude %{_bindir}/llvm-config
%{_bindir}/opt
%{_mandir}/man1/*
%exclude %{_mandir}/man1/clang.1.*
#%exclude %{_mandir}/man1/llvmg??.1.*
%doc CREDITS.TXT LICENSE.TXT
#doc llvm-testlog.txt
%files -n libllvm
%defattr(-,root,root)
%{_sysconfdir}/ld.so.conf.d/llvm-%{_arch}.conf
%dir %{_libdir}/llvm
%{_libdir}/llvm/*.so
%files -n libllvm-devel
%defattr(-,root,root)
%{_bindir}/llvm-config
%{_includedir}/%{name}
%{_includedir}/%{name}-c
%{_libdir}/%{name}/*.a
%doc llvm-extradocs/html
%doc README.txt
%files clang
%defattr(-,root,root)
%{_bindir}/clang*
#%{_bindir}/c-index-test
%{_bindir}/scan-build
%{_bindir}/scan-view
#%{_bindir}/tblgen
%{_prefix}/lib/clang
%{_libdir}/clang-analyzer
%{_mandir}/man1/clang.1.*
%doc tools/clang/LICENSE.TXT
%files clang-devel
%defattr(-,root,root)
%{_includedir}/clang
%{_includedir}/clang-c
%doc tools/clang/{NOTES.txt,README.txt}
%doc tools/clang/docs
%files ocaml
%defattr(-,root,root)
%{_libdir}/ocaml/*.cma
%{_libdir}/ocaml/*.cmi
%files ocaml-devel
%defattr(-,root,root)
%{_libdir}/ocaml/*.a
%{_libdir}/ocaml/*.cmx*
%{_libdir}/ocaml/*.mli
%doc llvm-extradocs/ocamldoc/html
%changelog
* Tue Apr 29 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 3.1-2mamba
- move libraries to libllvm and rename llvm-devel to libllvm-devel
- also try to add a patch to fix bug #163 (http://bugs.openmamba.org/view.php?id=163)
* Fri Jul 20 2012 Silvan Calarco <silvan.calarco@mambasoft.it> 3.1-1mamba
- update to 3.1
* Thu Feb 23 2012 Ercole 'ercolinux' Carpanetto <ercole69@gmail.com> 3.0.-1mamba
- update to 3.0
* Sun Jul 10 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 2.9-1mamba
- update to 2.9
* Sat Jan 01 2011 Davide Madrisan <davide.madrisan@gmail.com> 2.8-1mamba
- package created by autospec