You are not logged in.

#1 2018-06-05 23:13:14

hpmachining
Member
From: Michigan
Registered: 2016-11-23
Posts: 40
Website

Review request: Adopting camotics package

I am considering adopting the orphaned package camotics. I re-wrote the PKGBUILD and would like feedback. The package requires v8-3.14 from the AUR.

# Maintainer: Paul Hentschel <paul at hpminc dot com>
# Contributer: Justin R. St-Amant <jstamant24 at gmail dot  com>

pkgname=('camotics' 'camotics-doc')
pkgver=1.1.1
pkgrel=1
_commit='d509225a67a76a8215b33155ac9b872765302e01'
_cbang='cbang'
_cbang_commit='86ea0ddde0c42c5b8eb3adb54dfa6c1ab90fd3e3'
pkgdesc="Open-Source Simulation & Computer Aided Machining"
arch=('x86_64')
url="http://camotics.org/"
license=('GPL2')
makedepends=('git'
             'scons'
             'glu'
             'qt4'
             'v8-3.14')
source=("$pkgname::git+https://github.com/CauldronDevelopmentLLC/CAMotics.git#commit=$_commit"
        "$_cbang::git+https://github.com/CauldronDevelopmentLLC/cbang.git#commit=$_cbang_commit")
sha256sums=('SKIP'
            'SKIP')

prepare() {
  cd "$srcdir/$_cbang"
  scons
}

build() {
  export CBANG_HOME="$srcdir/$_cbang"
  cd "$srcdir/$pkgname"
  
  # sed needed to prevent linking to qt5 libraries if installed.
  # Building with 'scons qt_version=4' didn't work.
  sed -i "s/Qt to use', 'auto/Qt to use', '4/" SConstruct
  scons
}

package_camotics() {
  depends=('glu'
           'qt4'
           'v8-3.14'
           'openssl'
           'sqlite')

  cd "$srcdir/$pkgname"
  scons install install_prefix="$pkgdir/usr"
  
  install -d "$pkgdir/usr/share/$pkgname"/tpl_lib
  cp -r tpl_lib/ "$pkgdir/usr/share/$pkgname"
  install -Dm644 -t "$pkgdir"/usr/share/applications CAMotics.desktop
  install -Dm644 -t "$pkgdir"/usr/share/pixmaps images/camotics.png
  install -Dm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md CHANGELOG.md COPYING LICENSE
}

package_camotics-doc() {
  pkgdesc="Examples projects for CAMotics"
  arch=('any')

  cd "$srcdir/${pkgname%-doc}"
  install -d "$pkgdir/usr/share/doc/${pkgname%-doc}"/examples
  cp -r examples/ "$pkgdir/usr/share/doc/${pkgname%-doc}"
  chmod 644 "$pkgdir/usr/share/doc/${pkgname%-doc}"/examples/camotics/camotics.svg
}

# vim:set ts=2 sw=2 et:

I also did a VCS version. Actually, I did this one first. Should Justin R. St-Amant be added as a contributer?

# Maintainer: Paul Hentschel <paul at hpminc dot com>

pkgname=('camotics-git' 'camotics-doc-git')
pkgver=r660.5c02a34
pkgrel=1
_cbang='cbang'
pkgdesc="Open-Source Simulation & Computer Aided Machining"
arch=('x86_64')
url="http://camotics.org/"
license=('GPL2')
makedepends=('git'
             'scons'
             'qt5-tools'
             'qt5-websockets'
             'v8-3.14')
source=("${pkgname%-git}::git+https://github.com/CauldronDevelopmentLLC/CAMotics.git"
        "$_cbang::git+https://github.com/CauldronDevelopmentLLC/cbang.git")
sha256sums=('SKIP'
            'SKIP')

pkgver() {
	cd "$srcdir/${pkgname%-git}"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "$srcdir/$_cbang"
  scons
}

build() {
  export CBANG_HOME="$srcdir/$_cbang"
  cd "$srcdir/${pkgname%-git}"
  scons
}

package_camotics-git() {
  depends=('qt5-websockets'
           'v8-3.14')
  provides=('camotics')
  conflicts=('camotics')

  cd "$srcdir/${pkgname%-git}"
  scons install install_prefix="$pkgdir/usr"
  
  install -d "$pkgdir/usr/share/${pkgname%-git}"/tpl_lib
  cp -r tpl_lib/ "$pkgdir/usr/share/${pkgname%-git}"
  install -Dm644 -t  "$pkgdir"/usr/share/applications CAMotics.desktop
  install -Dm644 -t "$pkgdir"/usr/share/pixmaps images/camotics.png
  install -Dm644 -t "$pkgdir/usr/share/doc/${pkgname%-git}" README.md CHANGELOG.md COPYING LICENSE
}

package_camotics-doc-git() {
  pkgdesc="Example projects and machines for CAMotics"
  arch=('any')
  provides=('camotics-doc')
  conflicts=('camotics-doc')

  cd "$srcdir/${pkgname%-doc-git}"
  install -d "$pkgdir/usr/share/doc/${pkgname%-doc-git}"/{examples,machines}
  cp -r examples/ "$pkgdir/usr/share/doc/${pkgname%-doc-git}"
  cp -r machines/ "$pkgdir/usr/share/doc/${pkgname%-doc-git}"
}

# vim:set ts=2 sw=2 et:

Please let me know what you think about how I did the PKGBUILDs, and if you think I am ready to be a package maintainer in the AUR.

Offline

#2 2018-06-06 14:20:59

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Review request: Adopting camotics package

Latest released version appears to be 1.1.1 , https://github.com/CauldronDevelopmentL … s/releases
Why are you trying to build against QT4 when the github site lists QT5 as a dependency ?

C! aka cbang is listed as a requirement for camotics and has it's own repo . Usually that means it should have it's own package.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2018-06-06 15:26:48

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: Review request: Adopting camotics package

cbang-git is a current makedepends of the package, why switch away from using it?

If it cannot be built because one dependency disappeared... well, get it fixed.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#4 2018-06-06 16:40:06

hpmachining
Member
From: Michigan
Registered: 2016-11-23
Posts: 40
Website

Re: Review request: Adopting camotics package

Lone_Wolf wrote:

Latest released version appears to be 1.1.1

That is the version I am pulling from the repository for the release PKGBUILD. Like I mentioned, I did the git version first, so I thought it would be easier to just change the commit hash to the tagged release in the repository. I can change it to use the source tarball if that is the preferred method.

Why are you trying to build against QT4 when the github site lists QT5 as a dependency ?

Because when I build v1.1.1 against QT5 (5.11), the program didn't work properly for me. Plus, the README file in the source tree has QT4 as the requirement. I will look into this more to see if I can get it work with QT5.

C! aka cbang is listed as a requirement for camotics and has it's own repo . Usually that means it should have it's own package.

Eschwartz wrote:

cbang-git is a current makedepends of the package, why switch away from using it?

I did it this way because it appears that I need to point CBANG_HOME to the C! source directory. If you look at the cbang-git PKGBUILD in the AUR you will see that it just copies the whole source after building to /opt. I thought the way I did it was cleaner. I think I will also need to create a versioned C! package to build v1.1.1, since I got errors trying to build it with the latest C!. Plus, there is this quote from the developer.

There haven't been any real releases of cbang. I tagged v1.0.1 for another project which needed a fixed reference code. GitHub automatically adds the source code of any tags to the releases page.

cbang is only used by a handful of subprojects. It's not intended for use beyond those projects. I keep everything up to date so that the latest versions all work together. I know this is not the best practice but cbang and all the projects that use cbang are developed nearly exclusively by me.

This is another reason I thought just building along side the package was a better way to go.

If it cannot be built because one dependency disappeared... well, get it fixed.

As for fixing the current cbang-git dependancy, I am pretty sure chakracore-cauldron-git can just be replaced with v8-3.14. I tried using the upstream chakracore (which builds as is) and patching the fork on the Cauldron site so it would build, but C! would not configure to use either one, saying it couldn't find a specific function in the library, even though it appears to be there. When I got it to work with v8-3.14, I gave up on chakracore.

I'll go back to the drawing board and see if I can solve these issues Let me know if there is anything else. Thanks for the feedback.

Offline

#5 2018-06-07 22:49:52

hpmachining
Member
From: Michigan
Registered: 2016-11-23
Posts: 40
Website

Re: Review request: Adopting camotics package

Here is an updated camotics-git PKGBUILD, along with a proposed cbang-git PKGBUILD. Please let me know what you think of both.

# Maintainer: Paul Hentschel <aur at hpminc dot com>

pkgname=('camotics-git' 'camotics-doc-git')
pkgver=r660.5c02a34
pkgrel=1
pkgdesc="Open-Source Simulation & Computer Aided Machining"
arch=('x86_64')
url="http://camotics.org/"
license=('GPL2')
makedepends=('git'
             'scons'
             'qt5-tools'
             'qt5-websockets'
             'boost'
             'cbang-git'
             'v8-3.14')
source=("${pkgname%-git}::git+https://github.com/CauldronDevelopmentLLC/CAMotics.git")
sha256sums=('SKIP')

pkgver() {
	cd "$srcdir/${pkgname%-git}"
	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  export CBANG_HOME=/usr/lib/cbang
  cd "$srcdir/${pkgname%-git}"
  scons
}

package_camotics-git() {
  depends=('qt5-websockets'
           'v8-3.14')
  provides=('camotics')
  conflicts=('camotics')

  cd "$srcdir/${pkgname%-git}"
  scons install install_prefix="$pkgdir/usr"
  
  install -d "$pkgdir/usr/share/${pkgname%-git}"/tpl_lib
  cp -r tpl_lib/ "$pkgdir/usr/share/${pkgname%-git}"
  install -Dm644 -t  "$pkgdir"/usr/share/applications CAMotics.desktop
  install -Dm644 -t "$pkgdir"/usr/share/pixmaps images/camotics.png
  install -Dm644 -t "$pkgdir/usr/share/doc/${pkgname%-git}" README.md CHANGELOG.md COPYING LICENSE
}

package_camotics-doc-git() {
  pkgdesc="Example projects and machines for CAMotics"
  arch=('any')
  provides=('camotics-doc')
  conflicts=('camotics-doc')

  cd "$srcdir/${pkgname%-doc-git}"
  install -d "$pkgdir/usr/share/doc/${pkgname%-doc-git}"/{examples,machines}
  cp -r examples/ "$pkgdir/usr/share/doc/${pkgname%-doc-git}"
  cp -r machines/ "$pkgdir/usr/share/doc/${pkgname%-doc-git}"
}

# vim:set ts=2 sw=2 et:
# Maintainer:
# Contributer: Paul Hentschel <aur at hpminc dot com>

pkgname=cbang-git
pkgver=r740.e3af3ce
pkgrel=2
pkgdesc="A library of cross-platform C++ utilities."
arch=('x86_64')
url="https://github.com/CauldronDevelopmentLLC/cbang"
license=('GPL2')
makedepends=('git'
             'scons'
             'v8-3.14')
provides=('cbang')
conflicts=('cbang')
source=("git+https://github.com/CauldronDevelopmentLLC/cbang.git")
md5sums=('SKIP')

pkgver() {
  cd "${pkgname%-git}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

build() {
  cd "${pkgname%-git}"
  scons 
}

package() {
  cd "${pkgname%-git}"
  scons install prefix="$pkgdir"/usr
  rm "$pkgdir"/usr/lib/libcbang.a
  install -Dm644 -t "$pkgdir/usr/lib/${pkgname%-git}"/lib lib/*.a
  cp -r config "$pkgdir/usr/lib/${pkgname%-git}"
}

# vim:set ts=2 sw=2 et:

Offline

#6 2018-06-08 14:22:51

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Review request: Adopting camotics package

"${pkgname%-git}"

Verify whether you need to remove the -git part, as your $pkgname already has the git suffix


- dependencies need work

cbang-git should have boost as dep, while camotics doesn't appear to need it.

cbang-git doesn't have any runtime depends atm, not sure what's needed at runtime but boost-libs and v8 come to mind.
Namcap output on package tarball can help with that.

Last edited by Lone_Wolf (2018-06-08 14:23:56)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2018-06-08 17:05:13

hpmachining
Member
From: Michigan
Registered: 2016-11-23
Posts: 40
Website

Re: Review request: Adopting camotics package

LoneWolf wrote:

cbang-git should have boost as dep, while camotics doesn't appear to need it.

Cbang uses a local version of boost in its source tree. This seems to be the case even if boost is installed before building. I am basing this assumption on grepping the build log for boost and all instances reference src/boost. A static library, libcbang-boost.a, is built, which camotics uses. I put boost as a makedepends in camotics so it could find the headers needed. I don't have it in depends, just makedepends. One alternative way would be to copy the src/boost directory to /usr/lib/cbang/ in the cbang-git package function. I would like your advice on what you think is the best way to handle this. The ways I can think of are:

  1. The way I have it now.

  2. Copy the src/boost directory to /usr/lib/cbang and remove boost as makedepends in camotics-git.

  3. Try to force cbang to use system boost, if installed.

cbang-git doesn't have any runtime depends atm, not sure what's needed at runtime but boost-libs and v8 come to mind.
Namcap output on package tarball can help with that.

Namcap comes up clean. I originally had v8-3.14 in depends and namcap issued a warning that is was unneeded. I think it only needs to be installed if you are building something, like camotics, that uses it. But cbang needs to be built with v8-3.14 installed in order to use it. But then again, I can't find anything but camotics that uses cbang, which is another reason I wanted to just include it in the camotic-git build instead of a separate package. Again, I'm not sure what the best approach is in this situation. Please advise.

Verify whether you need to remove the -git part, as your $pkgname already has the git suffix

I'm sure it's not needed. I just don't like the install directories to have -git appended to them. No problem to change if that is what is expected or preferred.

Offline

Board footer

Powered by FluxBB