Skip to content
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

[wip] Add go-ipfs 0.7.0 #13904

Closed
wants to merge 12 commits into from
Next Next commit
[wip] go-ipfs 0.7.0
  • Loading branch information
bollwyvl committed Jan 2, 2021
commit 885915c5dc21ec3e15e77feb1c81b1333905112d
50 changes: 50 additions & 0 deletions recipes/go-ipfs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/env bash
set -eux

export GOPATH="$( pwd )"
export CGO_ENABLED=1

module='github.com/ipfs/go-ipfs'

make build GOTAGS=openssl
mkdir -p $PREFIX/bin
cp cmd/ipfs/ipfs $PREFIX/bin/ipfs


gather_licenses() {
# shellcheck disable=SC2039 # Allow widely supported non-POSIX local keyword.
local module output tmp_dir acc_dir
output="${1}"
shift
tmp_dir="$(pwd)/gather-licenses-tmp"
acc_dir="$(pwd)/gather-licenses-acc"
mkdir "${acc_dir}"
cat > "${output}" <<'EOF'
--------------------------------------------------------------------------------
The output below is generated with `go-licenses csv` and `go-licenses save`.
================================================================================
EOF
for module ; do
cat >> "${output}" <<EOF
go-licenses csv ${module}
================================================================================
EOF
go get -d "${module}"
chmod -R +rw "$( go env GOPATH )"
go-licenses csv "${module}" | sort >> "${output}"
go-licenses save "${module}" --force --save_path="${tmp_dir}"
cp -r "${tmp_dir}"/* "${acc_dir}"/
done
# shellcheck disable=SC2016 # Not expanding $ in single quotes intentional.
find "${acc_dir}" -type f | sort | xargs -L1 sh -c '
cat <<EOF
--------------------------------------------------------------------------------
${2#${1%/}/}
================================================================================
EOF
cat "${2}"
' -- "${acc_dir}" >> "${output}"
rm -r "${acc_dir}" "${tmp_dir}"
}

gather_licenses ./third-party-licenses.txt "${module}/cmd/ipfs/ipfs"
50 changes: 50 additions & 0 deletions recipes/go-ipfs/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{% set version = "0.7.0" %}

package:
name: go-ipfs
version: {{ version }}

source:
url: https://github.com/ipfs/go-ipfs/releases/download/v{{ version }}/go-ipfs-source.tar.gz
sha256: c349802561a61c1efeade4e3e681723b76e9192edacc5a955cf5f68e49e57fba

build:
number: 0
detect_binary_files_with_prefix: False

requirements:
build:
- {{ compiler('c') }}
- go-cgo >=1.14.4
- make
host:
- openssl
run:
- openssl

test:
commands:
- ipfs --version

about:
home: https://ipfs.io
license: Apache-2.0 or MIT
license_file:
- LICENSE-APACHE
- LICENSE-MIT

summary: 'IPFS implementation in Go'

# The remaining entries in this section are optional, but recommended.
description: |
IPFS is a global, versioned, peer-to-peer filesystem. It combines good ideas
from previous systems such as Git, BitTorrent, Kademlia, SFS, and the Web.
It is like a single BitTorrent swarm, exchanging git objects. IPFS provides
an interface as simple as the HTTP web, but with permanence built-in. You
can also mount the world at /ipfs.
doc_url: https://docs.ipfs.io
dev_url: https://github.com/ipfs/go-ipfs

extra:
recipe-maintainers:
- bollwyvl