# Maintainer: MThinkCpp <mtc.maintainer[at]outlook.com>
pkgname='libc++'
pkgver=3.3
pkgrel=1
pkgdesc='C++ Standard Library implementation - libc++ is a new implementation of the C++ standard library, targeting C++11.'
url='http://libcxx.llvm.org'
license=('custom: University of Illinois "BSD-Like"')
arch=('i686' 'x86_64')
depends=('glibc' 'gcc-libs>=4.8') ##gcc-libs for libsupc++ binary
makedepends=('clang>=3.2' 'subversion' 'cmake' 'gcc') #gcc provides libsupc++ headers
source=("http://www.llvm.org/releases/${pkgver}/libcxx-${pkgver}.src.tar.gz") #Extracts to a folder ${srcdir}/libcxx.src
md5sums=('SKIP')
build() {
#get gcc libsupc++ include directories (and save to variables)
_gcc_include_dir=/usr/include/c++/$(gcc -dumpversion)
_gcc_platform_include_dir=${_gcc_include_dir}/$(gcc -dumpmachine)
#Build libc++ (see http://libcxx.llvm.org for more detail on the instructions)
#Build is done with clang
mkdir "${srcdir}/libcxx-${pkgver}.src/build"
cd "${srcdir}/libcxx-${pkgver}.src/build"
CC=clang CXX=clang++ cmake -G "Unix Makefiles" -DLIBCXX_CXX_ABI=libsupc++ -DLIBCXX_LIBSUPCXX_INCLUDE_PATHS="${_gcc_include_dir};${_gcc_platform_include_dir}"\
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr "${srcdir}/libcxx-${pkgver}.src"
make
}
package() {
#license
install -Dm644 "${srcdir}/libcxx-${pkgver}.src/LICENSE.TXT" "$pkgdir/usr/share/licenses/$pkgname/license.txt"
#Install libc++ to the ${pkgdir}
cd "${srcdir}/libcxx-${pkgver}.src/build"
make DESTDIR="${pkgdir}" install
}
Thanks to everyone who helped it to get to this stage (individual thanks in previous posts)
Update LLVM 3.3 now released (as of June 17th 2013, website release date).
]]># Maintainer: MThinkCpp <mtc.maintainer[at]outlook.com>
pkgname='libc++'
pkgver=3.3
pkgrel=1
pkgdesc='C++ Standard Library implementation - libc++ is a new implementation of the C++ standard library, targeting C++11.'
url='http://libcxx.llvm.org'
license=('custom: University of Illinois "BSD-Like"')
arch=('i686' 'x86_64')
depends=('glibc' 'gcc-libs>=4.8') ##gcc-libs for libsupc++ binary
makedepends=('clang>=3.2' 'subversion' 'cmake' 'gcc') #gcc provides libsupc++ headers
source=("http://llvm.org/pre-releases/3.3/rc2/libcxx-3.3rc2-source.tar.gz") #Extracts to a folder ${srcdir}/libcxx.src
md5sums=('SKIP')
build() {
#get gcc libsupc++ include directories (and save to variables)
_gcc_include_dir=/usr/include/c++/$(gcc -dumpversion)
_gcc_platform_include_dir=${_gcc_include_dir}/$(gcc -dumpmachine)
#Build libc++ (see http://libcxx.llvm.org for more detail on the instructions)
#Build is done with clang
mkdir "${srcdir}/libcxx.src/build"
cd "${srcdir}/libcxx.src/build"
CC=clang CXX=clang++ cmake -G "Unix Makefiles" -DLIBCXX_CXX_ABI=libsupc++ -DLIBCXX_LIBSUPCXX_INCLUDE_PATHS="${_gcc_include_dir};${_gcc_platform_include_dir}"\
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr "${srcdir}/libcxx.src"
make
}
package() {
#license
install -Dm644 "${srcdir}/libcxx.src/LICENSE.TXT" "$pkgdir/usr/share/licenses/$pkgname/license.txt"
#Install libc++ to the ${pkgdir}
cd "${srcdir}/libcxx.src/build"
make DESTDIR="${pkgdir}" install
}
Also, where is msg2 documented?
vi /usr/bin/makepkg, line 108. It keeps things more consistent. Personally I think using any form of print statement for anything other than debugging is simply additional noise. It's sad to see package maintainers (typically only in the AUR) do it although it's not a big deal. Shrug.
]]>I'm keeping the echo[es]. I may not need them, but I am still keeping them.
Well, I looked around the guidelines and did not see anything that discourages noise created by all those echos, but... It is always been the Unix 'style' for programs to be as quiet as possible and only create commentary when something goes awry. Kaustic, have you a link that I may have missed? Also, where is msg2 documented?
]]>I personally like being informed of what is happening in the PKGBUILD by the echo[es]
That's nice, remove them.
If you really want them use msg2 (or msg)
]]> Edit:
I'm keeping the echo "Message".
All the best,
-HG
]]># Maintainer: MThinkCpp <mtc.maintainer[at]outlook.com>
pkgname='libc++'
pkgver=3.3
pkgrel=1
pkgdesc='C++ Standard Library implementation - libc++ is a new implementation of the C++ standard library, targeting C++11.'
url='http://libcxx.llvm.org'
license=('custom: University of Illinois "BSD-Like"')
arch=('i686' 'x86_64')
depends=('glibc' 'gcc-libs>=4.8') ##gcc-libs for libsupc++ binary
makedepends=('clang>=3.2' 'subversion' 'cmake' 'gcc') #gcc provides libsupc++ headers
source=("http://llvm.org/pre-releases/3.3/rc2/libcxx-3.3rc2-source.tar.gz") #Extracts to a folder ${srcdir}/libcxx.src
md5sums=('SKIP')
build() {
#get gcc libsupc++ include directories (and save to variables)
echo "Acquiring gcc include directories (a.k.a. libsupc++ include dirs)"
_gcc_include_dir=/usr/include/c++/$(gcc -dumpversion)
_gcc_platform_include_dir=${_gcc_include_dir}/$(gcc -dumpmachine)
#Build libc++ (see http://libcxx.llvm.org for more detail on the instructions)
echo "Building ${pkgname} with clang++"
mkdir "${srcdir}/libcxx.src/build"
cd "${srcdir}/libcxx.src/build"
CC=clang CXX=clang++ cmake -G "Unix Makefiles" -DLIBCXX_CXX_ABI=libsupc++ -DLIBCXX_LIBSUPCXX_INCLUDE_PATHS="${_gcc_include_dir};${_gcc_platform_include_dir}"\
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr "${srcdir}/libcxx.src"
make
}
package() {
#license
install -Dm644 "${srcdir}/libcxx.src/LICENSE.TXT" "$pkgdir/usr/share/licenses/$pkgname/license.txt"
#install
echo "Installing ${pkgname}"
cd "${srcdir}/libcxx.src/build"
make DESTDIR="${pkgdir}" install
}
Are the modifications okay?
Otherwise thanks for looking at it.
Edit:
For the final release, I suspect (based on looking at the clang tarball format changes between pre-release and release) I will have to change the references to libcxx.src to libcxx-${pkgver}.src
Scimmia wrote:Style choice. I always prefer to cd to a full path at the beginning of the functions so I know for sure where I'm at if I'm going to issue command without a full path later. Same way all of those braces around the variable aren't needed, but some people prefer them.
They make me feel safe
All the best,
-HG
I prefer including the cd "${srcdir}", as it makes it explicit to me that I am in the $srcdir. Without it, I have no feeling of security that I am definitely in there.
]]>Style choice. I always prefer to cd to a full path at the beginning of the functions so I know for sure where I'm at if I'm going to issue command without a full path later. Same way all of those braces around the variable aren't needed, but some people prefer them.
They make me feel safe
All the best,
-HG
]]>On a related note, all the prepare, build, package functions begin in "${srcdir}", so it's not needed at the beginning of your cd/mkdir commands (unless you've already cd'd out of the $srcdir--it appears that you haven't).
Style choice. I always prefer to cd to a full path at the beginning of the functions so I know for sure where I'm at if I'm going to issue command without a full path later. Same way all of those braces around the variable aren't needed, but some people prefer them.
]]># Maintainer: MThinkCpp <mtc.maintainer[at]outlook.com>
pkgname='libc++'
pkgver=3.3
pkgrel=1
pkgdesc='C++ Standard Library implementation - libc++ is a new implementation of the C++ standard library, targeting C++11.'
url='http://libcxx.llvm.org'
license=('custom: University of Illinois "BSD-Like"')
arch=('i686' 'x86_64')
depends=('glibc' 'gcc-libs>=4.8') ##gcc-libs for libsupc++ binary
makedepends=('clang>=3.2' 'subversion' 'cmake' 'gcc') #gcc provides libsupc++ headers
source=("${pkgname}::svn+http://llvm.org/svn/llvm-project/libcxx/branches/release_33")
md5sums=('SKIP')
build() {
#get gcc libsupc++ include directories (and save to variables)
echo "Acquiring gcc include directories (a.k.a. libsupc++ include dirs)"
_gcc_include_dir=/usr/include/c++/$(gcc -dumpversion)
_gcc_platform_include_dir=${_gcc_include_dir}/$(gcc -dumpmachine)
#Build libc++ (see http://libcxx.llvm.org for more detail on the instructions)
echo "Building ${pkgname} with clang++"
mkdir "${srcdir}/${pkgname}/build"
cd "${srcdir}/${pkgname}/build"
CC=clang CXX=clang++ cmake -G "Unix Makefiles" -DLIBCXX_CXX_ABI=libsupc++ -DLIBCXX_LIBSUPCXX_INCLUDE_PATHS="${_gcc_include_dir};${_gcc_platform_include_dir}"\
-DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr "${srcdir}/${pkgname}"
make
}
package() {
#license
install -Dm644 "${srcdir}/${pkgname}/LICENSE.TXT" "$pkgdir/usr/share/licenses/$pkgname/license.txt"
#install
echo "Installing ${pkgname}"
cd "${srcdir}/${pkgname}/build"
make DESTDIR="${pkgdir}" install
}
Thanks for looking at it.
]]>And, as Scimmia noted earlier, you should really quote all uses of variables (especially in paths). So, when you cd to the build directory, the command would be best as the following (which isn't yet the case in your build function):
cd "${pkgname}/build"
All the best,
-HG
P.S., there's nothing wrong with specifying "${srcdir}", it's just often redundant.
]]>