You are not logged in.

#1 2019-03-21 16:42:22

andmars
Member
Registered: 2012-03-13
Posts: 349

Changed pkgname: "scid" to "scid-code"

Hi, I'd like to use scid for analyzing chess databases. The version in AUR is 4.6.4. However the latest version on sourceforge is 4.7.0. Usually it's not a big deal to change the PKGBUILD to reflect that version. Unfortunately they've changed it from "scid-4.6.4" to "scid-code-4.7.0" and now I'm having a hard time to get the PKGBUILD to work.

https://sourceforge.net/projects/scid/f … cid%204.6/
https://sourceforge.net/projects/scid/f … cid%204.7/

Since I'm not a coder maybe you guys can help me make adjustments to the PKGBUILD. Thanks in advance.

https://aur.archlinux.org/cgit/aur.git/ … ILD?h=scid

Offline

#2 2019-03-21 19:25:43

loqs
Member
Registered: 2014-03-06
Posts: 13,179

Re: Changed pkgname: "scid" to "scid-code"

Only build tested.

# Maintainer: Luis Sarmiento < Luis.Sarmiento-ala-nuclear.lu.se >

pkgname=scid
_pkgname=Scid
pkgver=4.7.0
_pkgver=4.7
pkgrel=1
pkgdesc="A Free Chess Database Application"
url="http://scid.sourceforge.net"
arch=('x86_64' 'i686')
license=('GPL')
# namcap says 'tk' is not needed. tlc is needed but tk has it as a dependency.
depends=('python' 'tk' 'desktop-file-utils')
optdepends=('snack: for sound support'
            'tkimg: for using some alternate sets of pieces')
options=('!emptydirs')
install="${pkgname}.install"
source=("https://sourceforge.net/projects/${pkgname}/files/${_pkgname}/${_pkgname}%20${_pkgver}/${pkgname}-code-${pkgver}.zip")
md5sums=('a7163436231a929cf828b186771dd526')

build() {
  cd $pkgname
  ./configure BINDIR=/usr/bin SHAREDIR=/usr/share/$pkgname
  make
}

package () {
  cd $pkgname
  make DESTDIR=$pkgdir install
  msg "Creating Desktop file"
  install -Dm644 $srcdir/$pkgname/resources/svg/scid.ico $pkgdir/usr/share/scid/scid.ico
  cat > $pkgname.desktop <<EOF
[Desktop Entry]
Version=1.0
Name=${_pkgname}
Comment=${pkgdesc}
Exec=${pkgname} %F
MimeType=application/x-chess-pgn
Icon=/usr/share/${pkgname}/${pkgname}.ico
Categories=Game;BoardGame;
Type=Application
Terminal=false
StartupNotify=false
EOF

  install -Dm644 $pkgname.desktop "$pkgdir"/usr/share/applications/$pkgname.desktop

  msg "Copying sound files"
  install -d "$pkgdir"/usr/share/sounds
  install -Dm644 sounds/*.wav "$pkgdir"/usr/share/sounds

  msg "Fix world writtable bit in books folder"
  find "$pkgdir"/usr/share/scid/books -type f -exec chmod 644 {} \;

  msg "Removing reference to '$pkgdir'"
  sed -i "s#$pkgdir##g" "$pkgdir"/usr/bin/$pkgname

  msg "Applying Polish language fix"
  sed -i 's/iso8859-1\ polish/iso8859-2\ polish/g' "$pkgdir"/usr/share/scid/tcl/language.tcl

}

Adjusted paths for 4.7.0,  let build() fail if make fails,  quoted $pkgdir,  shortedned paths.
Not addressed use of msg function,  lack of FULL RELRO due to make not using LDFLAGS,  make not using CPPFLAGS or CFLAGS.

Offline

#3 2019-03-21 19:39:57

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

Re: Changed pkgname: "scid" to "scid-code"

@loqs I'm too slow! I just finished up my version when I see you beat me to it :}. Anyways, here is how I addressed the  lack of FULL RELRO. What do you think?

build() {
  cd $pkgname
  ./configure BINDIR=/usr/bin SHAREDIR=/usr/share/$pkgname SCIDFLAGS="$LDFLAGS"
  sed -i "/LDFLAGS =$/d" engines/phalanx-scid/makefile
  make 
} 

Offline

#4 2019-03-21 20:15:35

loqs
Member
Registered: 2014-03-06
Posts: 13,179

Re: Changed pkgname: "scid" to "scid-code"

namcap detects tkscid as lacking FULL RELRO as well

build() {
  cd $pkgname
  ./configure BINDIR=/usr/bin SHAREDIR=/usr/share/$pkgname
  sed -i "/LDFLAGS =$/d" engines/phalanx-scid/makefile
  make CPP_FLAGS="$CXXFLAGS $LDFLAGS -pthread"
}

Your sed solution is much nicer than my clobbering CPP_FLAGS.
Edit:
replace two sed lines with -pthread

Last edited by loqs (2019-03-21 23:46:48)

Offline

#5 2019-03-21 23:25:51

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

Re: Changed pkgname: "scid" to "scid-code"

loqs wrote:

namcap detects tkscid as lacking FULL RELRO as well

I wasn't seeing that with my build(). Did you see the SCIDFLAGS="$LDFLAGS" that I added to the configure line? That should have taken care of it. Could change it to SCIDFLAGS="$CXXFLAGS $LDFLAGS". The flag defaults to none, so I figured it was OK to use.

Last edited by hpmachining (2019-03-22 02:44:43)

Offline

#6 2019-03-21 23:39:16

loqs
Member
Registered: 2014-03-06
Posts: 13,179

Re: Changed pkgname: "scid" to "scid-code"

No I missed SCIDFLAGS="$LDFLAGS" thank you for pointing that out.
Edit:

build() {
  cd $pkgname
  ./configure BINDIR=/usr/bin SHAREDIR=/usr/share/$pkgname SCIDFLAGS="$LDFLAGS" OPTIMIZE="$CXXFLAGS"
  sed -i "/LDFLAGS =$/d" engines/phalanx-scid/makefile
  sed -i "s|^CFLAGS = -O3|^CFLAGS +=|" engines/phalanx-scid/makefile
  make
} 

Does that address all the flag issues?

Last edited by loqs (2019-03-22 00:14:38)

Offline

#7 2019-03-22 02:42:02

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

Re: Changed pkgname: "scid" to "scid-code"

loqs wrote:

Does that address all the flag issues?

Looks to me like you got everything covered.

On another note, it looks like the last 2 seds in package() are not doing anything anymore, so can be removed.

Offline

#8 2019-03-24 15:58:45

andmars
Member
Registered: 2012-03-13
Posts: 349

Re: Changed pkgname: "scid" to "scid-code"

Thank you guys for helping me out with the PKGBUILD.
Now I'm just wondering why did the author of the PKGBUILD change the direction of certain files? When I download the master file from: https://sourceforge.net/p/scid/code/ci/master/tree/ and do a "./configure" and "sudo make install" it installs to "/usr/local/share/scid" and the rest to "/usr/local/bin/" while the PKGBUILD changes it to "/usr/share/" and "/usr/bin". Might be a total n00b-question but scid works fine either way.

Offline

#9 2019-03-24 16:18:18

Slithery
Forum Moderator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 4,236

Re: Changed pkgname: "scid" to "scid-code"

Because /usr/local is meant for programs not tracked by a package manager.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Online

Board footer

Powered by FluxBB