You are not logged in.

#1 2011-02-12 20:11:51

vfbsilva
Member
From: Brazil
Registered: 2010-04-08
Posts: 103

SystemC package

Folks I created a systemc pakcage there are many things to improve and corrections to make. But at least it works now in arch. I'm posting it here to get some help and feedback.
There are MANY problems it is my first package. Hope it helps some more people.

PKGBUILD:

# This is an example PKGBUILD file. Use this as a start to creating your own,
# and remove these comments. For more information, see 'man PKGBUILD'.                     
# NOTE: Please fill out the license field for your package! If it is unknown,              
# then please put 'unknown'.                                                               
                                                                                           
# Maintainer:Victor Silva <vfbsilva@gmail.com>                                             
pkgname=systemc                                                                            
pkgver=2.2.0                                                                               
pkgrel=1                                                                                   
pkgdesc=""                                                                                 
arch=('i686' 'x86_64')                                                                     
url="http://www.systemc.org/home/"                                                         
license=('custom')                                                                         
groups=()                                                                                  
depends=()                                                                                 
makedepends=()                                                                             
optdepends=()                                                                              
provides=()                                                                                
conflicts=()                                                                               
replaces=()                                                                                
backup=()                                                                                  
options=()                                                                                 
install=                                                                                   
changelog=                                                                                 
source=($pkgname-$pkgver.tgz systemc-2.2.0_64.patch)                                       
noextract=()                                                                               
md5sums=('ccd0a9b8987b2902de647cfd0794e668'                                                
         '44effaed5da37d137daed11961386b99')                                               
                                                                                           
build() {                                                                                  
  cd "$srcdir/$pkgname-$pkgver"                                                            
  patch -p1 < ../systemc-2.2.0_64.patch                                                    
  mkdir objtmp                                                                             
  cd objtmp                                                                                
  ../configure                                                                             
  make                                                                                     
  make install                                                                             
}                                                                                          
                                                                                           
package() {                                                                                
  cd "$srcdir/$pkgname-$pkgver"                                                            
  mkdir -p "$pkgdir/usr/lib"                                                               
  install -m 644 objtmp/src/libsystemc.a "$pkgdir/usr/lib/"                                
  mkdir -p "$pkgdir/usr/include"                                                           
  install -m 644 src/systemc src/systemc.h "$pkgdir/usr/include/"                          
  cp -r include/sysc "$pkgdir/usr/include/"                                                
  chmod -R a=rX,u+w "$pkgdir/usr/include/sysc"                                             
  mkdir -p "$pkgdir/usr/share/doc/$pkgname-$pkgver"                                        
  cp -r docs/* "$pkgdir/usr/share/doc/$pkgname-$pkgver/"                                   
  chmod -R a=rX,u+w "$pkgdir/usr/share/doc/$pkgname-$pkgver/"                              
}                                                                                          
                                                                                           
# vim:set ts=2 sw=2 et:

I had to patch the original systemc so I could build in gcc 4.0 and newer, this patch was given to me by Andrea Pieretti

diff -crB systemc-2.2.0/src/sysc/utils/sc_utils_ids.cpp systemc-2.2.0.bak/src/sysc/utils/sc_utils_ids.cpp                                                                             
*** systemc-2.2.0/src/sysc/utils/sc_utils_ids.cpp       2006-12-15 18:31:39.000000000 -0200
--- systemc-2.2.0.bak/src/sysc/utils/sc_utils_ids.cpp   2010-01-27 10:38:20.216268336 -0200
***************                                                                            
*** 59,65 ****                                                                             
  //                                                                                       
                                                                                           
  #include "sysc/utils/sc_report.h"                                                        
!                                                                                          
                                                                                           
  namespace sc_core {                                                                      
  #define SC_DEFINE_MESSAGE(id,unused,text) extern const char id[] = text;                 
--- 59,67 ----                                                                             
  //                                                                                       
                                                                                           
  #include "sysc/utils/sc_report.h"                                                        
! #include <string.h>                                                                      
! #include <stdlib.h>                                                                      
! #include <stdio.h>                                                                       
                                                                                           
  namespace sc_core {                                                                      
  #define SC_DEFINE_MESSAGE(id,unused,text) extern const char id[] = text;                 
***************                                                                            
*** 107,113 ****                                                                           
                                                                                           
      // PROCESS ANY ENVIRONMENTAL OVERRIDES:                                              
                                                                                           
!     const char* deprecation_warn = std::getenv("SC_DEPRECATION_WARNINGS");               
      if ( (deprecation_warn!=0) && !strcmp(deprecation_warn,"DISABLE") )                  
      {                                                                                    
          sc_report_handler::set_actions("/IEEE_Std_1666/deprecated",                      
--- 109,115 ----                                                                           
                                                                                           
      // PROCESS ANY ENVIRONMENTAL OVERRIDES:                                              
                                                                                           
!     const char* deprecation_warn = getenv("SC_DEPRECATION_WARNINGS");                    
      if ( (deprecation_warn!=0) && !strcmp(deprecation_warn,"DISABLE") )                  
      {                                                                                    
          sc_report_handler::set_actions("/IEEE_Std_1666/deprecated"

The original systemc package can be fetched from www.systemc.org
Regards

Offline

Board footer

Powered by FluxBB