Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Hue #40150

Closed
wants to merge 11 commits into from
157 changes: 157 additions & 0 deletions Library/Formula/hue.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
class Hue < Formula
desc "Hue is a Web interface for analyzing data with Apache Hadoop."
homepage "http://gethue.com/"
Copy link
Contributor

Choose a reason for hiding this comment

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

You can use https:// here.

Copy link

Choose a reason for hiding this comment

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

Good point but gethue.com does not have https yet, it will break the page on modern browsers

Copy link
Contributor

Choose a reason for hiding this comment

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

Right it breaks the page.

url "https://github.com/cloudera/hue/archive/release-3.8.1.tar.gz"
# version "3.8.1" # redundant with version scanned from URL
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this comment.

sha256 "582777f567b9f4a34e4ce58cfd5ed24aff15f3e02f193e7990329d8cb0161a8a"

# system dependencies - either Homebrew or Mac OS versions
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove this comment.

depends_on :java
depends_on :python
Copy link
Contributor

Choose a reason for hiding this comment

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

Adding a :python dependency introduces a hard dependency on Homebrew python for bottles. If it's not important which Python this is built against, please remove the :python dependency so it will always be built against system Python.

Copy link
Author

Choose a reason for hiding this comment

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

Done.

depends_on :mysql

depends_on "maven" => :build
depends_on "openssl" => :optional
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be mandatory or you need to find a way to tell Hue's build scripts not to build against openssl if build.without? "openssl".

Copy link
Author

Choose a reason for hiding this comment

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

I made the dependency on "openssl" the default, and added an option to allow the use of system installed OpenSSL

  option "with-system-openssl", "Build with the Mac OS system OpenSSL instead of the (more secure) latest Homebrew version"
  depends_on "openssl" unless build.with? "system-openssl"

depends_on "gmp"

patch :DATA
Copy link
Member

Choose a reason for hiding this comment

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

Can you please submit this patch to the upstream developers of this project and add a link to the upstream patch submission and explanation of why the patch is needed in a comment in the formula file. Thanks!


def install
# patched the Makefile vars to install to ${PREFIX}/libexec
system "make", "-j", "1", "install", "PREFIX=#{prefix}"
Copy link
Contributor

Choose a reason for hiding this comment

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

Use ENV.deparallelize instead of passing -j1 directly to make.

Copy link
Author

Choose a reason for hiding this comment

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

Done.


(libexec/"desktop/conf").install "desktop/conf.dist/hue.ini"
etc.install_symlink "#{libexec}/desktop/conf/hue.ini"

bin.install_symlink "#{libexec}/build/env/bin/hue"
end

test do
fork do
system "#{bin}/hue", "runserver"
end
sleep(6)

begin
system "curl", "-s", "-S", "-f", "-L", "http://localhost:8000"
assert_equal 0, $?.exitstatus
ensure
sleep(2)
system "pkill", "-f", "hue"
end
end
end
__END__
diff --git a/desktop/core/ext-py/tablib-develop/setup.py b/desktop/core/ext-py/tablib-develop/setup.py
index fb16546..6f3bcfe 100755
--- a/desktop/core/ext-py/tablib-develop/setup.py
+++ b/desktop/core/ext-py/tablib-develop/setup.py
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is this patch necessary and has it been submitted upstream?

Copy link

Choose a reason for hiding this comment

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

Would Hue need this or a rebase on latest tablib? (that way you don't need this here)

@@ -36,36 +36,46 @@ if sys.argv[-1] == 'test':
os.system('py.test test_tablib.py')
sys.exit()

-setup(
- name='tablib',
- version=tablib.__version__,
- description='Format agnostic tabular data library (XLS, JSON, YAML, CSV)',
- long_description=(open('README.rst').read() + '\n\n' +
- open('HISTORY.rst').read()),
- author='Kenneth Reitz',
- author_email='[email protected]',
- url='http://python-tablib.org',
- packages=[
- 'tablib', 'tablib.formats',
- 'tablib.packages',
+packages = [
+ 'tablib', 'tablib.formats',
+ 'tablib.packages',
+ 'tablib.packages.omnijson',
+ 'tablib.packages.unicodecsv'
+]
+
+if sys.version_info[0] == 2:
+ packages.extend([
'tablib.packages.xlwt',
- 'tablib.packages.xlwt3',
'tablib.packages.xlrd',
- 'tablib.packages.xlrd3',
- 'tablib.packages.omnijson',
'tablib.packages.odf',
- 'tablib.packages.odf3',
'tablib.packages.openpyxl',
'tablib.packages.openpyxl.shared',
'tablib.packages.openpyxl.reader',
'tablib.packages.openpyxl.writer',
+ 'tablib.packages.yaml'
+ ])
+else:
+ packages.extend([
+ 'tablib.packages.xlwt3',
+ 'tablib.packages.xlrd3',
+ 'tablib.packages.odf3',
'tablib.packages.openpyxl3',
'tablib.packages.openpyxl3.shared',
'tablib.packages.openpyxl3.reader',
'tablib.packages.openpyxl3.writer',
- 'tablib.packages.yaml',
- 'tablib.packages.unicodecsv'
- ],
+ 'tablib.packages.yaml3'
+ ])
+
+setup(
+ name='tablib',
+ version=tablib.__version__,
+ description='Format agnostic tabular data library (XLS, JSON, YAML, CSV)',
+ long_description=(open('README.rst').read() + '\n\n' +
+ open('HISTORY.rst').read()),
+ author='Kenneth Reitz',
+ author_email='[email protected]',
+ url='http://python-tablib.org',
+ packages=packages,
license='MIT',
classifiers=(
'Development Status :: 5 - Production/Stable',

diff --git a/desktop/core/ext-py/parquet-python/parquet/bitstring.py b/desktop/core/ext-py/parquet-python/parquet/bitstring.py
index ab807a2..7203c94 100644
--- a/desktop/core/ext-py/parquet-python/parquet/bitstring.py
+++ b/desktop/core/ext-py/parquet-python/parquet/bitstring.py
Copy link
Contributor

Choose a reason for hiding this comment

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

Same question here.

Copy link
Author

Choose a reason for hiding this comment

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

Patch has been submitted upstream.

@@ -1,7 +1,5 @@
-
SINGLE_BIT_MASK = [1 << x for x in range(7, -1, -1)]

-]

class BitString(object):

@@ -10,7 +8,6 @@ class BitString(object):
self.offset = offset if offset is not None else 0
self.length = length if length is not None else 8 * len(data) - self.offset

-
def __getitem__(self, key):
try:
start = key.start
@@ -18,5 +15,5 @@ class BitString(object):
except AttributeError:
if key < 0 or key >= length:
raise IndexError()
- byte_index, bit_offset = divmod(self.offset + key), 8)
- return self.bytes[byte_index] & SINGLE_BIT_MASK[bit_offset]
\ No newline at end of file
+ byte_index, bit_offset = (divmod(self.offset + key), 8)
+ return self.bytes[byte_index] & SINGLE_BIT_MASK[bit_offset]
diff --git a/Makefile.vars.priv b/Makefile.vars.priv
index 79bc443..e17e192 100644
--- a/Makefile.vars.priv
+++ b/Makefile.vars.priv
@@ -53,7 +53,7 @@ BLD_DIR_DOC := $(BLD_DIR)/docs

# Installation directory
PREFIX ?= /usr/local
-INSTALL_DIR ?= $(PREFIX)/hue
+INSTALL_DIR ?= $(PREFIX)/libexec
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like you could pass this on the command line instead of patching, i.e. make install PREFIX=#{prefix} INSTALL_DIR=#{prefix}/libexec.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, that was the first thing I tried. When I set INSTALL_DIR from the command line, I get the following error when the first Hue web submodule is installed:

--- Making built distribution at /private/tmp/hue20150531-47630-1au188t/hue-release-3.8.1/desktop/core/build/bdist/desktop-3.8.1
--- Install built distribution for desktop at /usr/local/Cellar/hue/3.8.1/libexec
ERROR: /usr/local/Cellar/hue/3.8.1/libexec not empty. Cowardly refusing to continue.
make[2]: *** [install-bdist] Error 1
make[1]: *** [.recursive-install-bdist/core] Error 2
make: *** [install-desktop] Error 2

It looks like this is happening inside this target:

https://github.com/cloudera/hue/blob/master/Makefile.sdk#L245

So, I'd need to patch anyways.

I'm going to open an issue with Hue. For now, patching the INSTALL_DIR variable instead of setting it on the command line works fine.

INSTALL_APPS_DIR ?= $(INSTALL_DIR)/desktop/apps

ifeq ($(INSTALL_DIR),$(patsubst /%,%,$(INSTALL_DIR)))