Skip to content

xschem: new port of xschem schematic editor for EDA #28171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions science/xschem/Portfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0

name xschem
version 3.4.6
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

latest upstream version is 3.4.7 by now

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to get 3.4.7 to download through the existing framework on sourceforge, but I was unable to do so. I also have not extensively tested 3.4.7, and for that reason we are using 3.4.6 until I can get a chance to give it some testing.

revision 0
license GPL-2
categories science cad

maintainers {gmail.com:degnan.68k @bpdegnan} \
openmaintainer

description schematic capture and netlisting EDA tool
long_description \
Xschem is a schematic capture program that supports digital, analog, behavioral \
circuit design and simulation. It is designed to interface well with ngspice \
and other simulation tools.

homepage https://xschem.sourceforge.io/stefan/index.html

distname ${name}-${version}
master_sites sourceforge:xschem


checksums rmd160 bf5f75f9e0838293515796bdead483ff2b667049 \
sha256 a46bd296b2b9f8436370892eb81264599c2e3ae84b298d7a4e3b89c4126185e7 \
size 14990039

set docdir ${prefix}/share/doc/${name}

depends_build path:bin/pkg-config:pkgconfig
depends_lib port:cairo \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you. might want to include path:include/turbojpeg.h:libjpeg-turbo \ here as well since the configure script looks for it.

There appear to be more dependencies listed than upstream gives as required/optional.... For example, where does freetype, Xft2, readline come from? I suggest to take another close look at the requirements here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed a bunch of stuff here, and honestly, I don't recall why I needed it. I have been using macports to support my local software for awhile, and I think a lot of this was legacy. I was able to strip out all of those except xpm.

port:xorg-libxcb \
port:xrender \
port:xpm \
port:tcl \
port:tk \
port:xorg-libX11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also please align the dependencies in the same was as the rest of the Portfile - why four additional spaces here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I got this.




destroot {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overriding the complete destroot phase is a bit unconventional; is there no install target that will take care of some of these things already? If you need to copy extra stuff, you would typically do that in a post-destroot phase.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope that I got this updated correctly. I, honestly, don't know what I was thinking.

set bindir ${destroot}${prefix}/bin
set sharedir ${destroot}${prefix}/share/xschem
set docdir ${destroot}${prefix}/share/doc/${name}

xinstall -d ${bindir} ${sharedir} ${docdir}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am pretty sure that MacPorts creates the bin and share directory already so that seems redundant, please double check


# Install the main binary
xinstall -m 755 ${worksrcpath}/src/xschem ${bindir}

# Install all .tcl, .awk, and xschemrc from src/
foreach f [glob -nocomplain -directory ${worksrcpath}/src *.tcl *.awk xschemrc] {
if {[file exists $f]} {
xinstall -m 644 $f ${sharedir}
}
}

# Install example schematics and library files
foreach dir {xschem_library} {
set srcdir "${worksrcpath}/${dir}"
if {[file exists $srcdir]} {
copy $srcdir ${sharedir}
}
}

# Now explicitly copy systemlib from src/
if {[file exists ${worksrcpath}/src/systemlib]} {
copy ${worksrcpath}/src/systemlib ${sharedir}
}
# Install documentation if present
foreach docfile {README.md README LICENSE AUTHORS INSTALL} {
set srcfile "${worksrcpath}/${docfile}"
if {[file exists $srcfile]} {
xinstall -m 644 $srcfile ${docdir}
}
}
}

livecheck.type regex
livecheck.url https://sourceforge.net/projects/xschem/files/
livecheck.regex {xschem-([0-9.]+)\.tar\.gz}

notes "
Xschem has been installed to ${prefix}/bin/xschem.
Libraries and examples are in ${prefix}/share/xschem.
You may wish to create ~/.xschem/xschemrc for custom settings.
"